Colorful numbers: Difference between revisions
m
→{{header|AppleScript}}: Minor improvements.
m (→{{header|AppleScript}}: Typo.) |
m (→{{header|AppleScript}}: Minor improvements.) |
||
Line 95:
=={{header|AppleScript}}==
<syntaxhighlight lang="applescript">(*
obtained so far is actually reached, it's the last colorful number at that magnitude. The
*)
on isColorful(n)
Line 138 ⟶ 137:
set counter to 0
set counts to {}
set magnitude to 1 --
set largestReverse to 9 -- Largest reverse of a single-digit number!
set n to
repeat
▲ if ((n mod 10 > 1) or (magnitude < 2)) and (isColorful(n)) then
if (n < 100) then set end of colorfuls to text -3 thru -1 of (" " & n)
set counter to counter + 1
Line 153 ⟶ 148:
set counter to 0
set magnitude to magnitude * 10
if (magnitude >
set n to
else
set temp to n
Line 165 ⟶ 160:
end if
end if
set n to n + 3
else
set n to n + 1
end if
end repeat
|