An All-American Puzzle Hunt
Logical Programs
Which country has the best computer science programs? America! (don’t quote this, please) Practice with these programs and find out what weird event happened in one of them!
|
|
|
|
|
|
|
|
n
|
=
|
'
|
0
|
x
|
'
|
;
|
l
|
o
|
g
|
i
|
c
|
=
|
'
|
0
|
a
|
'
|
;
|
l
|
=
|
c
|
o
|
n
|
s
|
o
|
l
|
e
|
.
|
l
|
o
|
g
|
;
|
f
|
=
|
S
|
t
|
r
|
i
|
n
|
g
|
.
|
f
|
r
|
o
|
m
|
C
|
o
|
d
|
e
|
P
|
o
|
i
|
n
|
t
|
;
|
g
|
=
|
0
|
1
|
+
|
1
|
0
|
0
|
1
|
0
|
0
|
-
|
0
|
x
|
0
|
;
|
p
|
r
|
i
|
=
|
(
|
n
|
,
|
'
|
t
|
1
|
+
|
+
|
0
|
3
|
f
|
(
|
1
|
s
|
"
|
t
|
1
|
%
|
1
|
0
|
+
|
-
|
c
|
%
|
s
|
1
|
1
|
%
|
2
|
%
|
s
|
2
|
1
|
.
|
1
|
%
|
c
|
"
|
2
|
2
|
,
|
3
|
2
|
2
|
+
|
3
|
|
0
|
+
|
2
|
2
|
*
|
2
|
+
|
2
|
0
|
-
|
2
|
3
|
0
|
/
|
1
|
1
|
3
|
+
|
2
|
'
|
,
|
|
'
|
1
|
,
|
t
|
1
|
"
|
r
|
a
|
z
|
1
|
0
|
*
|
0
|
s
|
"
|
,
|
1
|
|
"
|
3
|
i
|
e
|
'
|
,
|
-
|
"
|
1
|
2
|
s
|
1
|
0
|
|
0
|
2
|
"
|
,
|
|
1
|
2
|
2
|
3
|
&
|
1
|
|
&
|
~
|
0
|
2
|
-
|
3
|
3
|
3
|
*
|
2
|
)
|
+
|
l
|
o
|
g
|
i
|
c
|
;
|
h
|
=
|
0
|
1
|
1
|
*
|
0
|
x
|
c
|
e
|
*
|
0
|
1
|
;
|
h
|
=
|
h
|
*
|
0
|
x
|
f
|
+
|
'
|
f
|
'
|
.
|
c
|
o
|
d
|
e
|
P
|
o
|
i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