% $Id: hash.slang,v 1.0 2003/01/03 14:09:00 dada Exp $ % http://dada.perl.it/shootout/ % % contributed by John E. Davis define main () { variable n = integer (__argv[1]); variable X = Assoc_Type[Int_Type]; _for (1, n, 1) { variable i = (); X[sprintf("%x", i)] = i; } variable c = 0; _for (n, 1, -1) { i = (); if (assoc_key_exists (X, string(i))) c++; } vmessage ("%d", c); } main();