Created
October 8, 2017 00:08
-
-
Save cristianmiranda/0434b51bb7d02b43701795a8953dd630 to your computer and use it in GitHub Desktop.
RPN - && ||
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
if (a == 10 && b >= 30) { | |
y = y + 1; | |
} else { | |
y = y - 1; | |
} | |
1 - a | |
2 - 10 | |
3 - CMP | |
4 - BNE | |
5 - 19 | |
7 - b | |
8 - 30 | |
9 - CMP | |
10 - BLT | |
11 - 19 | |
12 - y | |
13 - y | |
14 - 1 | |
15 - + | |
16 - = | |
17 - BI | |
18 - 24 | |
19 - y | |
20 - y | |
21 - 1 | |
22 - - | |
23 - = | |
24 - | |
############################################################ | |
############################################################ | |
############################################################ | |
if (x < y || x < z) { | |
y = y + 1; | |
} | |
1 - x | |
2 - y | |
3 - CMP | |
4 - BLT | |
5 - 14 | |
7 - x | |
8 - z | |
9 - CMP | |
10 - BLT | |
11 - 14 | |
12 - BI | |
13 - 19 | |
14 - y | |
15 - y | |
16 - 1 | |
17 - + | |
18 - = | |
19 - | |
############################################################ | |
############################################################ | |
############################################################ | |
if (a == 10 && b >= 30) { | |
y = y + 1; | |
} else { | |
if (x < 10 || a == 20) { | |
y = 1; | |
} else { | |
y = y - 1; | |
} | |
} | |
1 - a | |
2 - 10 | |
3 - CMP | |
4 - BNE | |
5 - 19 | |
7 - b | |
8 - 30 | |
9 - CMP | |
10 - BLT | |
11 - 19 | |
12 - y | |
13 - y | |
14 - 1 | |
15 - + | |
16 - = | |
17 - BI | |
18 - 39 | |
19 - x | |
20 - 10 | |
21 - CMP | |
22 - BLT | |
23 - 31 | |
24 - a | |
25 - 20 | |
26 - CMP | |
27 - BEQ | |
28 - 31 | |
29 - BI | |
30 - 34 | |
31 - y | |
32 - 1 | |
33 - = | |
34 - y | |
35 - y | |
36 - 1 | |
37 - - | |
38 - = | |
39 - | |
############################################################ | |
############################################################ | |
############################################################ | |
if (x == z && x < y || x < z) { | |
y = 1; | |
} | |
1 - x | |
2 - z | |
3 - CMP | |
4 - BNE | |
5 - 12 | |
7 - x | |
8 - y | |
9 - CMP | |
10 - BLT | |
11 - 17 | |
12 - x | |
13 - z | |
14 - CMP | |
15 - BGE | |
16 - 20 | |
17 - y | |
18 - 1 | |
19 - = | |
20 - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cris, todo bien?
Haciendo las Polacas vemos que coincidimos en casi todo. Fijate que te salteaste la numeración de las posiciones y no pusiste la posición 6, después todo joya.
Respecto a la polaca 2 y la polaca 3, hicimos el segundo salto del OR distinto:
Fijate y lo vemos así nos corregimos.

Abrazo.