FizzBuzz/Basic: Difference between revisions
Content added Content deleted
Basicgames (talk | contribs) |
Basicgames (talk | contribs) |
||
Line 240: | Line 240: | ||
sleep</syntaxhighlight> |
sleep</syntaxhighlight> |
||
=={{header|FTCBASIC}}== |
|||
<syntaxhighlight lang="basic">'uses carry command to perform modulus |
|||
'uses flag variable for elseif structure |
|||
define i = 0, f = 0, r = 0 |
|||
do |
|||
let i = i + 1 |
|||
let f = 1 |
|||
let r = i / 15 |
|||
carry r |
|||
if r = 0 then |
|||
let f = 0 |
|||
print "FizzBuzz" |
|||
endif |
|||
let r = i / 3 |
|||
carry r |
|||
if r = 0 and f = 1 then |
|||
let f = 0 |
|||
print "Fizz" |
|||
endif |
|||
let r = i / 5 |
|||
carry r |
|||
if r = 0 and f = 1 then |
|||
let f = 0 |
|||
print "Buzz" |
|||
endif |
|||
if f = 1 then |
|||
print i |
|||
endif |
|||
loop i < 100 |
|||
pause |
|||
end</syntaxhighlight> |
|||
===GW-BASIC=== |
===GW-BASIC=== |