1 USING: arrays help.markup help.syntax kernel math ;
5 { $description "Starts the game!" }
11 "Commands: { + - * / rot swap q }\n"
14 "Commands: { + - * / rot swap q }\n"
17 "Commands: { + - * / rot swap q }\n"
20 "Commands: { + - * / swap q }\n"
27 { $values { "array" array } }
29 "Produces a vector with 4 integers. With the following condition: "
30 "If these integers were directly on the stack, one can process them into 24, "
31 "just using the provided commands and the 4 numbers. The Following are the "
33 { $link + } ", " { $link - } ", " { $link * } ", "
34 { $link / } ", " { $link swap } ", and " { $link rot } "."
38 "USING: 24-game kernel sequences prettyprint ;"
39 "make-24 length 4 = ."
42 { $notes { $link makes-24? } " is used in " { $link makes-24? } "." }
54 "Tells if it is possible to win 24-game with these integers."
57 ARTICLE: "24-game" "The Game of 24"
58 "A classic math game, where one attempts to create 24, by applying "
59 "arithmetical operations and some shuffle words to a stack of 4 numbers."