| « Prev | Page 1 | Page 2 | Page 3 | Next » |
Re: Krypto and 24
2010-05-05 09:18
•
by
St.Pepper
(unregistered)
|
Fail! |
|
This sounds rather similar to the "numbers game" in the British game show Countdown (more details on Wiki at http://en.wikipedia.org/wiki/Countdown_(game_show)#Numbers_round).
|
|
Once you've solved these on your own, check out Rosetta Code to see examples of a "24" game and a player for such in a variety of languages.
Again, don't check it out until you've done it yourself, or you spoil much of the purpose of this blog post... http://rosettacode.org/wiki/24_game http://rosettacode.org/wiki/24_game/Solve (Disclaimers: Yes, it's my site. No, I didn't write that code. No, I'm not participating in writing one for this blog post; I've already seen other people solve it in a couple dozen languages. I just thought some of the coder geeks around here might fine it interesting.) |
|
For some reason, this reminds me of Alex Zane's games...
|
|
No offense, but you were a major nerd :)
|
|
I think the real WTF is that Alex had friends...
|
|
Wow. Just . . . wow.
I never played these card games, but I thought I was the only one who would take a series of numbers from some random place (could be anything -- license plates, telephone numbers, SSNs, etc.) and try to insert mathematical symbols to make the preceding numbers have a total of the last digit (or last couple of digits, whatever worked). To find that there's actually a card game for this . . . I wouldn'ta thunk it. |
BODMAS? |
|
The other RWTF is that the red-suit cards are printed in black.
|
First of all, let's remember that 'Countdown' is itself based on the French game show 'Des Chiffres Et Des Lettres.' :) Also, the Countdown numbers game is somewhat different, though I agree that Krypto (and yes that IS the name of Superman's dog) has some basic similarities. Countdown's game has a random three-digit 'target,' and one chooses from two set of numbers: one set is 25, 50, 75, and 100; the other set is two lots of the numbers 1 through 10. You can choose from one to four 'big' numbers, which are made up to a total of six numbers by random picks from the 'small numbers.' (And since all non-UK readers have already dozed off ;), did you know that TWO large numbers is the choice that gives the best chance of a solution existing? Check out this site: http://www.crosswordtools.com/numbers-game/) |
I thought the same I wrote a solver for countdown (letters and numbers games) in J2ME many many years ago (when that was all the rage), wonder where it is. |
There are a couple of other differences, in countdown any divisions can't be fractions so you can't do (9/2) + 1 = 5.5 * 10 = 55 and in countdown not all numbers must be used. |
|
The only solution I can think of, off the top of my head, involves recursion. And so I can't do the Easy solution, I have to do Medium or better. Is there something I'm missing here?
|
|
For an extra challenge, assign units to the suits and require that the units in the result have to be correct.
|
Quite right Ziplodocus. This smacks of another WTFiction. |
You can do Medium, but not easy ?!
I'm a little disappointed in you... |
|
We played this in grade 4, only we also used the face cards.
|
Re: Krypto and 24
2010-05-05 10:12
•
by
St.Pepper
(unregistered)
|
Please tell what set of cards contains numeric values above 10. |
Re: Krypto and 24
2010-05-05 10:16
•
by
Anonymous
(unregistered)
|
All of them. The ace is worth 11 in many card games and all packs have 4 aces, so... |
Tarot. The Major Arcana are numbered in a proper deck... 16 would be The Tower. |
|
Booooooooooooooooooooooooooooring.
Though I like the 24 game... Bonus points for the person who can come up with the hardest 24 game puzzle. |
|
Messy thrown together javascript:
Doesn't handle parentheses, but oh well. |
My puzzle: 3 7 9 9 |
|
3 * (7 + 9 / 9) = 24
Sorry for the newb question, but why would I want to do this elementary coding exercise? |
Re: Krypto and 24
2010-05-05 10:56
•
by
Anonymous
(unregistered)
|
Are you setting up for a joke? OK, I'll bite: "I don't know, why would you want to do this elementary coding exercise?" ... |
Ahh, damn it. I missed that solution. My intended solution was (9*7+9)/3... And why you would want to do the exercise? No idea. I've always wondered why it exists on this site. It doesn't fit, imho. |
Re: Krypto and 24
2010-05-05 11:12
•
by
tentative
(unregistered)
|
|
I knew it!
So this site has another side, huh? Is it worth 10 minutes of coding to get there? |
Re: Krypto and 24
2010-05-05 11:15
•
by
Not him.
(unregistered)
|
It fits to the extent that the intent of the site is to improve code and highlight particularly bad and to-be-avoided practices |
|
"Dammit Chloe, where's that access code?!"
Whoops, wrong "24". |
|
Here's an excellent clip of Countdown where the guy solves the numbers round in amazing fashion... Who'd have thought it was possible :)
http://www.youtube.com/watch?v=pfa3MHLLSWI |
|
Presumably not all of the readers of this site are super-genius coders like (ahem) you and I. Maybe there's people who haven't already solved every problem there is reading this. I know, it's terrible, you're associated with "noobs" just by reading a site that they're allowed to read. Sorry.
|
Because small hacks in joke languages like Intercal can be fun, but writing real applications in Intercal is not. Also, if you happen to be learning or want to learn a new language, small problems are a good way to jump in and get your feet wet. Starting with a real application as your first project in an unfamiliar language leads to the types of things we see regularly on this site. |
|
Partial solution in C++:
* Plays 24 * Allows any number of cards as input * Outputs as RPN * Does NOT filter out equivalent solutions Assumptions: * Input will be valid * Operations are done via floating point * As per standard rules, can reorders cards To use, compile as "_24" and echo the cards or enter from console: > echo '3 3 3 3' | ./_24 3 3 * 3 * 3 - > echo '7 8 9 7 1' | ./_24 8 7 / 1 + 7 * 9 + 8 9 + 7 / 1 + 7 * 9 7 / 1 + 7 * 8 + 9 7 - 8 * 1 + 7 + 9 7 - 8 * 7 + 1 + 9 8 + 7 / 1 + 7 *
|
Re: Krypto and 24
2010-05-05 11:47
•
by
Go Figure
(unregistered)
|
(7*9+9)/3 |
Re: Krypto and 24
2010-05-05 12:13
•
by
cellocgw
(unregistered)
|
OK, but first: bonus points for someone who can define "hardest" in this context. |
|
public static void main (String[] args)
{ System.out.println("42"); } |
Re: Krypto and 24
2010-05-05 12:33
•
by
Spellcheck
(unregistered)
|
|
What about the url?
> http://thedailywtf.com/Articles/Krytpo-and-24.aspx |
Wow Sheldon you are such a geek! No wonder you can't even get Irish Girl to appear on your site any more. |
Ahem. You and me. |
|
I tried this once. Failed because the code couldn't solve 2,7,7,10 for 24.
Hint/Spoiler: Problem difficulty may increase severalfold at this point, depending on what language you're using. |
|
Bonus points to whoever can find all problems that have only one non-duplicated solution.
|
|
Ahem, 'me and you' or 'you and I'.
|
Using my submission got: 10 7 / 2 + 7 * Which translates in standard bracketed notation to: (10 / 7 + 2) * 7 = 24 |
my abs |
FTFY |
|
My high school girlfriend and I would play this game on occasion. She introduced it to me. She was awesome, valedictorian in HS, top honors at her engineering program at a major university (she was #1 or 2 of her class), and she's currently married and a stay-at-home mom... she is awesome.
|
|
My prefered variant is with seven dice, two are different colours. Roll 'em. The two become a two-digit number, the other five are used to try to make it.
|
Re: Krypto and 24
2010-05-05 14:12
•
by
YeahRight
(unregistered)
|
Win for CREEEEEEEPY. |
| « Prev | Page 1 | Page 2 | Page 3 | Next » |