24-game: flush output, add some tests.

db4
John Benediktsson 2012-06-19 23:11:10 -07:00
parent 81e5c32225
commit 36c38b7c86
2 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1,6 @@
USING: 24-game sequences tools.test ;
IN: 24-game.tests
{ t } [ make-24 first4 makes-24? ] unit-test

View File

@ -42,7 +42,7 @@ CONSTANT: (operators) { + - * / rot swap q }
[ name>> = ] with find nip ; [ name>> = ] with find nip ;
: get-operator ( operators -- word ) : get-operator ( operators -- word )
"Operators: " write dup pprint nl "Operators: " write dup pprint nl flush
readln over find-operator dup readln over find-operator dup
[ "Command not found..." print get-operator ] unless nip ; [ "Command not found..." print get-operator ] unless nip ;