Skip to content

Commit 53bebed

Browse files
committed
create persistent speed
1 parent 7453fae commit 53bebed

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
main
1+
main
2+
spaceship

main.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ int t()
1717
memcpy(&f[Y + j][X], &s[j * u], u)
1818
#define l(x, y, w, h, a, b, c, d) \
1919
!((x - a > c && x >= a) || (a - x > w && a >= x) || (y - b > d && y >= b) || (b - y > h && b >= y))
20-
#define f(x) \
20+
#define f(x, y, z) \
21+
y += z * d; \
2122
strcpy(b, x); \
2223
break
2324

@@ -53,17 +54,13 @@ int main()
5354
switch (u) // could be minified...
5455
{
5556
case 65:
56-
p.y -= d * 15;
57-
f(" /\\ / \\ vv ");
57+
f(" /\\ / \\ vv ", p.y, -20);
5858
case 66:
59-
p.y += d * 15;
60-
f(" ^^ \\ / \\/ ");
59+
f(" ^^ \\ / \\/ ", p.y, 20);
6160
case 67:
62-
p.x += d * 15;
63-
f("<\\ < ></ ");
61+
f("<\\ < ></ ", p.x, 40);
6462
case 68:
65-
p.x -= d * 15;
66-
f(" />< > \\>");
63+
f(" />< > \\>", p.x, -40);
6764
}
6865
p.x = p.x < 4 ? 4 : p.x >= w - 4 ? w - 4
6966
: p.x;

0 commit comments

Comments
 (0)