Paste: a first test

Author: rks
Mode: factor
Date: Thu, 23 Dec 2010 13:51:27
Plain Text |
USING: kernel random math math.parser 
    io combinators prettyprint ;
IN: pom

: main ( -- )
    100 random [ 
        "Entrez un nombre entre 0 et 99 : " print
        readln string>number {
            { [ 2dup < ] [ "C'est moins !" print t ] }
            { [ 2dup > ] [ "C'est plus !" print t ] }
            [ "C'est gagné !" print f ]
        } cond nip
    ] loop drop ;

MAIN: main

New Annotation

Summary:
Author:
Mode:
Body: