Created
September 12, 2017 13:38
-
-
Save hectormethod/952e6affa8c5c55bba3ebc572fc84dff to your computer and use it in GitHub Desktop.
WHILE tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x := 1; | |
z := 0 | |
-------- | |
x11 := (2 + 3) * 5; | |
z__ := x11 + 2 | |
---- | |
x := 3; | |
y := 1; | |
while ( not x = 1) do | |
( y := y * x; | |
x := x - 1) | |
------ | |
xy := 1; | |
yx := 2; | |
if (xy <= yx) then (a:= 100) else (a:=200) | |
------ | |
if (not false) then | |
(a:= 100) | |
else | |
( if (1 = 1) then (skip) else ( a:=200; skip)); | |
b := 1 | |
------ | |
a:=0; | |
b:=6; | |
if ( false ) then | |
( a:= 1; b:=0 ) | |
else | |
( if (a+5 = b-1) then | |
(a := 3; | |
b := 1; | |
while ( not a = 1) do | |
( | |
b := b * a; | |
a := a - 1 | |
) | |
) | |
else ( a:=1; b:=0; skip) | |
); | |
skip | |
------ | |
BAD missing ( | |
a:=0; | |
b:=6; | |
if false ) then | |
( a:= 1; b:=0 ) | |
else | |
( if (a+5 = b-1) then | |
(a := 3; | |
b := 1; | |
while ( not a = 1) do | |
( | |
b := b * a; | |
a := a - 1 | |
) | |
) | |
else ( a:=1; b:=0; skip) | |
); | |
skip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment