RosettaCodeData/Task/Babbage-problem/Vedit-macro-language/babbage-problem.vedit

26 lines
713 B
Plaintext

// Vedit Macro Language stores numerical values in numeric registers,
// referred as #0 to #255.
// Check all positive integer values until the required value found
for (#1 = 1; #1 < MAXNUM; #1++) {
#2 = #1 * #1 // #2 = square of the value
// The operator % is the modulo operator (the remainder of division).
// Modulo 1000000 gives the last 6 digits of a value.
#3 = #2 % 1000000
if (#3 == 269696) {
break // We found it, lets stop here
}
}
if (#1 < MAXNUM) {
Message("The smallest number whose square ends in 269696 is ", NOCR)
Num_Type(#1)
Message("The square is ", NOCR)
Num_Type(#2)
} else {
Message("Condition not satisfied before MAXNUM reached.)
}