For those who have spent hours mastering the art of TI-84 programming, I challenge you to make a 24 solver (given 4 inputs which are integers, use +, -, *, /, and () to create 24) on a TI-84.
Of course, this is much easier using a language such as Python or Java, but it would be much more of a c...
Description
Find all sets of a list, each set will have 3 number that satisfies the largest number is equal to the sum of 2 another numbers.
Rule:
Given a list that contains a number of element
Each element is a number (it must be a integer to prevent Floating-Point Arithmetic problem)
A nu...
Common Celebrity is leading Health & Fitness Blog operated by Manu Arora. Manu is a Lifestyle Blogger,Health Nut, Fitness Freak & Corporate Professional. Consult with Manu today for your fitness & health.
Weight loss is a basic problem in today's general public with obesity on the increase and...
One Line Task: 'for..'
The task is, use a for loop to count the number of numbers that fall within a certain range.
By default, you have the following declared variables:
$ : contains the numbers. *
x : contains the lower bound.
y : contains the upper bound.
r : this is where you should leave t...
Task
Write a function that accepts two integers a,b that represent the Gaussian integer z = a+ib (complex number). The program must return true or false depending on whether a+ib is a Gaussian prime or not.
Definition:
a + bi is a Gaussian prime if and only if it meets one of the following con...
Calculate Coefficient of Inbreeding
Your task is, given a family tree, to calculate the Coefficient of Inbreeding for a given person in it. This is code-golf.
Definition
The Coefficient of Inbreeding is equal to the Coefficient of Relationship of the parents. The Coefficient of Relationship be...
Gained about 3000 rep. But more importantly, I moved up a few places on the leaderboard so I'm back on the second page. Not bad for.... umm... holy crap... three years with basically no activity.
@dzaima "an equation for the max amount of steps it can take which doubles as the complexity" actually the max amount of steps wouldn't give the *exact* complexity
also how do you define "function"? a trivial solution would be "f(n)=the max number of steps taken by this program to compute any input of length n"
similarly in the first paragraph, you don't take "y(x0) = y0" as input (that would mean you just take y0 as input), instead you take x0, y0 that satisfy y0 = y(x0)
What is the consensus for including the boilerplate for languages like C# in the byte count? I'm sure this has been discussed before but I looked on meta but I'm guessing my search skills are lacking. I have an answer in .Net Core that I'd like to reduce the byte count down to just the body of a lambda method so I have the boilerplate (namespace, class, Main, etc.) in the header/footer on TIO. Does that make sense?
I went from lambda l:{*filter(lambda p:p[0]+p[1]==p[2],c(sorted(l),3))} to lambda l:{p for p in c(sorted(l),3)if p[0]+p[1]==p[2]} or lambda l:{(a,b,c)for a,b,c in c(sorted(l),3)if a+b==c}
This challenge was posted as part of the April 2018 LotM challenge, as well as for Brain-flak's 2nd birthday
I was thinking about what the most efficient way to encode brain-flak programs would be. The obvious thing to do, since there are only 8 valid characters, is to map each character to a ...
@Malivil yeah, excluding lambda type & variable (and also the trailing semicolon as it's not strictly necessary there to evaluate the function!) is standard for java/C#/etc
ASCII texturing
Write a function or a full program that apply an ASCII texture to a 2d shape.
Inputs : shape, texture, dimensions(optionally).
Both Shape and Texture can be given by any convenient method (2d matrix, array of strings or string whit newlines)
Shape data have a rectangular sha...
@Geobits I was assuming it would be two. If there's more, do the top two bidders pay, or every bidder?
In 2-player, Not bidding is a legit strategy, but if your goal is to earn more than everyone else (or lose less) everyone who goes up against you starts making more
In the general form, it's open to multiple players, but it usually ends up being a two-person escalation in the end. But, even in two-player, not bidding may make sense. Yes, they make more money against you, but given enough players doing the escalation with others, you may make more (or at least lose less) overall.
I don't think there is any general strategy to ensure you make more than not ever bidding. If I were allowed two entries, I'd make one never bid (A), and the other always bid up .05, no matter what (B). That would ensure that all entries who play against B lose some amount of money, while A sits at zero.
I probably wouldn't have to actually submit B, though, because someone else likely would.
@Geobits But if you can see who you're playing, you know you're going up against B, so you see it's not in your interest to get in a bidding-war with it
Then you can recoup some losses when playing against A
(Or at least, you can tell where you're going up against B's strategy)
If it were a two or three person thing, then sure, I'd agree there are better ways to play it. But with ten or more submissions, the odds that any bot will actually win money over the long run goes down dramatically, I think. If you bid at all, you have to win the bid or lose money. The only time I think you could realistically make money is if you bid only when facing a bot you know will not bid back (and the bid is under 1.00).
But that's not all that interesting. It only really even works in real life due to bad human judgement, crowd pressure, etc.
Alright, how about a modified dollar-auction. Anyone can bid at anytime, but once you win a dollar you can't bid in future rounds. The top two bidders must both pay.
Then either it ends once there aren't enough bidders (stop either at 2 or 3?) or do a pre-decided number of rounds
This reminds me of an alternate bidding method I heard about for real auctions, that supposedly is a more fair way of guaranteeing A) The person who wants it the most gets it, and B) That person ends up paying a fair price.
I can't remember what it's called
But everyone secretly writes down the highest price they would be willing to pay. The auctioneer collects and reads them, and then the person who wrote the largest number wins. But, the price they pay for it is the second highest number
(may need a better title)
Can this village have a wedding?
The quaint hamlet of Кодгольф in the Russian far east has a problem: their population is low (below 66), and no new people have arrived for years. Moreover, after centuries of near-isolation, just about everybody is related to each othe...