RosettaCodeData/Task/Babbage-problem/Frink/babbage-problem.frink

18 lines
458 B
Plaintext

// This is a solver for the Rosetta Code problem "Babbage problem"
// https://rosettacode.org/wiki/Babbage_problem
i = 1
while true
{
// mod is the modulus operator.
// The == operator is a test for equality. A single =
// assigns to a variable.
if i² mod million == 269696
{
// This prints i and i²
println[i + "² = " + i²]
exit[] // This terminates the program if a solution is found.
}
i = i + 1
}