Anonymous user
Multiplication tables: Difference between revisions
→{{header|AppleScript}}
Line 51:
=={{header|AppleScript}}==
<lang AppleScript >
set text item delimiters to ""▼
return (characters -4 thru -1 of (" " & x)) as string▼
end f▼
repeat with x from 0 to n
if x = 0 then set {R, x} to {{return}, -1}
Line 63 ⟶ 58:
if x > 0 then set RR to {f(x as string)}
if x = -1 then set {RR, x} to {{f("x")}, 1}
else
if y ≥ x then set end of RR to f(x * y)
Line 72 ⟶ 66:
end repeat
return R as string
-- Handler/Function for formatting fixed width integer string.
on f(x)
▲ set text item delimiters to ""
▲ return (characters -4 thru -1 of (" " & x)) as string
▲end f
</lang>Output:
<pre>"
|