]> gitweb.factorcode.org Git - factor.git/commitdiff
poker: use map-product from sequences.extras.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 10 Apr 2013 16:25:09 +0000 (09:25 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 10 Apr 2013 16:25:09 +0000 (09:25 -0700)
extra/poker/poker.factor

index 4a192f8e77ee8aa99c4c0585a681f5f926adc7d6..1f6bf11ab0ec40f2e46ef1f67904ebe02f56d68b 100644 (file)
@@ -1,10 +1,10 @@
 ! Copyright (c) 2009 Aaron Schaefer, Doug Coleman. All rights reserved.
 ! The contents of this file are licensed under the Simplified BSD License
 ! A copy of the license is available at http://factorcode.org/license.txt
-USING: accessors arrays ascii assocs binary-search combinators
-fry kernel locals math math.bitwise math.combinatorics
-math.order math.statistics poker.arrays random sequences
-sequences.product splitting grouping lexer strings ;
+USING: arrays ascii assocs combinators fry kernel lexer locals
+math math.bitwise math.combinatorics math.order math.statistics
+poker.arrays random sequences sequences.extras
+sequences.product splitting strings ;
 FROM: sequences => change-nth ;
 IN: poker
 
@@ -128,9 +128,6 @@ M: integer >ckf ;
 : lookup ( cards table -- value )
     [ rank-bits ] dip nth ;
 
-: map-product ( seq quot -- n )
-    [ 1 ] 2dip [ dip * ] curry [ swap ] prepose each ; inline
-
 : prime-bits ( cards -- q )
     [ 0xFF bitand ] map-product ;