On Jan 18, Rick Klement said: >> 4 numbers (all from 1-9) are given, make a formula(include +-*/()) for >> result 24. ex: >> >> 4, 2, 7, 5 >> (4-2)*(7+5) = 24 >> >> shortest/quickest solution? > >most straightforward (ducks...)
This feels like a card-game I play every now and then called... (drum roll)... 24. Values are 1 through 13 (Ace through King), and apart from just +, -, *, and /, we allow powers, roots, and logarithms. 8 3 Q 10 oculd be solved as log[3]8 + 12 + 10 It's a fun game. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course.