]> gitweb.factorcode.org Git - factor.git/commitdiff
24-game: flush output, add some tests.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 20 Jun 2012 06:11:10 +0000 (23:11 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 20 Jun 2012 06:11:10 +0000 (23:11 -0700)
extra/24-game/24-game-tests.factor [new file with mode: 0644]
extra/24-game/24-game.factor

diff --git a/extra/24-game/24-game-tests.factor b/extra/24-game/24-game-tests.factor
new file mode 100644 (file)
index 0000000..daa93cb
--- /dev/null
@@ -0,0 +1,6 @@
+
+USING: 24-game sequences tools.test ;
+
+IN: 24-game.tests
+
+{ t } [ make-24 first4 makes-24? ] unit-test
index b834299ac4fab2ce8e5fba49c6a8c8d0bbd711ee..de9cfbeafc5b1debe532e82e5f573bef04f71652 100644 (file)
@@ -42,7 +42,7 @@ CONSTANT: (operators) { + - * / rot swap q }
     [ name>> = ] with find nip ;
 
 : get-operator ( operators -- word )
-    "Operators: " write dup pprint nl
+    "Operators: " write dup pprint nl flush
     readln over find-operator dup
     [ "Command not found..." print get-operator ] unless nip ;