\ -*- mode: forth -*-
\ $Id: hash.gforth,v 1.1 2001/05/25 21:30:18 doug Exp $
\ http://www.bagley.org/~doug/shootout/
\ from Anton Ertl:
0. argc @ 1- arg >number 2drop drop constant NUM
wordlist constant x
: build
get-current x set-current
base @ hex
NUM 0 ?do
i 0 <# #s #> nextname i constant
loop
base ! set-current ;
: countdecs
0 0 NUM -do
i 0 <# #s #> x search-wordlist if
drop 1+
endif
1 -loop
;
build countdecs 0 .r cr bye