Skip to content

Commit

Permalink
rock-paper-scissors: cleanup, test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed Oct 7, 2013
1 parent 2497d94 commit c2c57cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions rock-paper-scissors/rock-paper-scissors-tests.factor
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
USING: kernel tools.test ;

IN: rock-paper-scissors

{ t } [ \ scissors \ paper beats? ] unit-test
{ f } [ \ scissors \ paper swap beats? ] unit-test
{ t } [ \ rock \ scissors beats? ] unit-test
{ f } [ \ rock \ scissors swap beats? ] unit-test
{ t } [ \ paper \ rock beats? ] unit-test
{ f } [ \ paper \ rock swap beats? ] unit-test
{ f } [ \ rock \ rock beats? ] unit-test
{ f } [ \ paper \ paper beats? ] unit-test
{ f } [ \ scissors \ scissors beats? ] unit-test
4 changes: 2 additions & 2 deletions rock-paper-scissors/rock-paper-scissors.factor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
USING: combinators formatting io kernel multi-methods random ;
FROM: multi-methods => GENERIC: ;
USING: combinators formatting io kernel random ;
FROM: multi-methods => GENERIC: METHOD: ;
IN: rock-paper-scissors

SINGLETONS: rock paper scissors ;
Expand Down

0 comments on commit c2c57cc

Please sign in to comment.