100 doors: Difference between revisions
→{{header|Euler}}: Use Mediawiki markup for syntax highlighting
(→{{header|ALGOL 60}}: Syntax highlight with Mediawiki markup) |
(→{{header|Euler}}: Use Mediawiki markup for syntax highlighting) |
||
Line 5,389:
=={{header|Euler}}==
In Euler, all variables have the value <code>undefined</code> until assigned another value. <code>isu x</code> returns <code>true</code> if x is currently undefined and the and/or operators short-circuit.
'''begin''' '''new''' doors; '''new''' i; '''label''' doorLoop; '''label''' outDoors;
'''new''' j; '''label''' flipLoop;
▲doorLoop: if [ i <- i + 1 ] <= length doors then begin
flipLoop: '''if''' [ j <- J + i ] <= '''length''' doors '''then''' '''begin'''
'''end''' '''else'''
'''end''' '''else'''
outDoors: '''if''' [ i <- i + 1 ] <= '''length''' doors '''then''' '''begin'''
'''end''' '''else'''
'''end''' $▼
▲end $
=={{header|Euler Math Toolbox}}==
|