24-game: Fix the docs.

db4
Doug Coleman 2012-06-20 00:37:09 -07:00
parent 36c38b7c86
commit 9ddef268e1
1 changed files with 17 additions and 21 deletions

View File

@ -1,12 +1,12 @@
USING: help.markup help.syntax math kernel ; USING: help.markup help.syntax math kernel arrays ;
IN: 24-game IN: 24-game
HELP: play-game HELP: 24-game
{ $description "Starts the game!" } { $description "Starts the game!" }
{ $examples { $examples
{ $unchecked-example { $unchecked-example
"USE: 24-game" "USE: 24-game"
"play-game" "24-game"
"{ 8 2 1 2 }\n" "{ 8 2 1 2 }\n"
"Commands: { + - * / rot swap q }\n" "Commands: { + - * / rot swap q }\n"
"swap\n" "swap\n"
@ -23,8 +23,8 @@ HELP: play-game
} }
} ; } ;
HELP: 24-able HELP: make-24
{ $values { "vector" "vector of 4 integers" } } { $values { "array" array } }
{ $description { $description
"Produces a vector with 4 integers. With the following condition: " "Produces a vector with 4 integers. With the following condition: "
"If these integers were directly on the stack, one can process them into 24, " "If these integers were directly on the stack, one can process them into 24, "
@ -36,34 +36,30 @@ HELP: 24-able
{ $examples { $examples
{ $example { $example
"USING: 24-game kernel sequences prettyprint ;" "USING: 24-game kernel sequences prettyprint ;"
"24-able length 4 = ." "make-24 length 4 = ."
"t" "t"
} }
{ $notes { $link 24-able? } " is used in " { $link 24-able } "." } { $notes { $link makes-24? } " is used in " { $link makes-24? } "." }
} ; } ;
HELP: 24-able? HELP: makes-24?
{ $values { $values
{ "quad" "vector of 4 integers" } { "a" integer }
{ "t/f" "a boolean" } { "b" integer }
{ "c" integer }
{ "d" integer }
{ "?" "a boolean" }
} }
{ $description { $description
"Tells if it is possible to win 24-game if it was initiated " "Tells if it is possible to win 24-game with these integers."
"with this sequence."
} ; } ;
HELP: build-quad
{ $values
{ "array" "an array of 4 numbers" }
}
{ $description "Builds an array of 4 random numbers." } ;
ARTICLE: "24-game" "The Game of 24" ARTICLE: "24-game" "The Game of 24"
"A classic math game, where one attempts to create 24, by applying " "A classic math game, where one attempts to create 24, by applying "
"arithmetical operations and some shuffle words to a stack of 4 numbers. " "arithmetical operations and some shuffle words to a stack of 4 numbers. "
{ $subsections { $subsections
play-game 24-game
24-able make-24
24-able? makes-24?
build-quad
} ; } ;
ABOUT: "24-game" ABOUT: "24-game"