]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/rosetta-code/knapsack-unbounded/knapsack-unbounded.factor
Harmonize spelling
[factor.git] / extra / rosetta-code / knapsack-unbounded / knapsack-unbounded.factor
index 55f54c0f5adbd13c3eaa3cf319228a2c25f3929b..77f4830e0aec3268be007c5d15270690d80aac08 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (c) 2012 Anonymous
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors combinators kernel locals math math.order
+USING: accessors combinators kernel math math.order
 math.vectors sequences sequences.product combinators.short-circuit ;
 IN: rosetta-code.knapsack-unbounded
 
@@ -20,12 +20,12 @@ IN: rosetta-code.knapsack-unbounded
 ! He can only take whole units of any item, but there is much
 ! more of any item than he could ever carry
 
-! How many of each item does he take to maximise the value of
+! How many of each item does he take to maximize the value of
 ! items he is carrying away with him?
 
 ! Note:
 
-! There are four solutions that maximise the value taken. Only
+! There are four solutions that maximize the value taken. Only
 ! one need be given.
 
 CONSTANT: values { 3000 1800 2500 }
@@ -40,9 +40,9 @@ TUPLE: bounty amounts value weight volume ;
 : <bounty> ( items -- bounty )
     [ bounty new ] dip {
         [ >>amounts ]
-        [ values v. >>value ]
-        [ weights v. >>weight ]
-        [ volumes v. >>volume ]
+        [ values vdot >>value ]
+        [ weights vdot >>weight ]
+        [ volumes vdot >>volume ]
     } cleave ;
 
 : valid-bounty? ( bounty -- ? )