Name | Language | Tokens Sum | Tokens Part 1 | Tokens Part 2 | Last change | |
---|---|---|---|---|---|---|
1 | Python | 273 | 135 | 138 | 8 months ago | |
2 | Ruby | 351 | 181 | 170 | 8 months ago |
dirs
=
[
(
0
,
1
)
,
(
1
,
0
)
,
(
0
,
-
1
)
,
(
-
1
,
0
)
]
s
=
y
=
x
=
0
for
d
,
num
in
(
(
int
(
c
[
7
]
)
,
int
(
c
[
2
:
7
]
,
16
)
)
for
c
in
[
line
.
split
(
)
[
-
1
]
for
line
in
open
(
0
)
]
)
:
y2
=
y
+
num
*
dirs
[
d
]
[
0
]
x2
=
x
+
num
*
dirs
[
d
]
[
1
]
s
+=
num
+
y2
*
x
-
x2
*
y
y
,
x
=
y2
,
x2
print
(
s
//
2
+
1
)