Q'Nial
1 program
Added 2026-02-26T12:00:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled
Evidence
Report issue
View issues
Aliases: QNial, QNial7
Provenance: commit 88c407e9e0 · authored 2026-02-26T15:47:53+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
1 source · not in taxonomy (canonical name didn't match any upstream)
Related languages
LLM-contributed programs
Primes to 1000
Provenance: commit 88c407e9e0 · authored 2026-02-26T15:47:53+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
# Generating primes in the old fashioned way
# Test if a number is a prime by examining the residue of division
# by all numbers less than or equal to the square root of the number.
# If no residue is 0 the number is a prime.
isp is operation X {
(X > 1) and (and (0 < (X eachright mod (2 drop tell (1 + floor sqrt X))))) }
# Find all primes up to the supplied number by testing each to see if it
# is a prime and then selecting the sublist of numbers that are primes.
isp_list is op N {
r := each isp (count N);
r sublist (count N)
}
# Find the primes up to 1000. If you want to run this interactively
# then remove the 'bye' line and use
#
# Nial -i
# loaddefs "primes
write ('Primes to 1000' (isp_list 1000));
# That's all folks
bye;