Duck Programming Language Scratchpad
Enter program source code or statements to evaluate:
; prime numbers example limit = 100 count = 0 duck.println("Primes less than " + limit + ":") numbers = [] for i = 2 to limit do numbers[i] = 1 loop for i = 2 to limit do if numbers[i] == 1 then count = count + 1 for j = 2 to limit/i do numbers[i*j] = 0 loop duck.println(count + ". " + i) end loop
Evaluate