r/shittyprogramming • u/Mmarco94 • Dec 18 '15
super approved My university assigned me a task: build a tic tac toe C program... so I made this beauty!
http://pastebin.com/JNWYBiKc
333
Upvotes
r/shittyprogramming • u/Mmarco94 • Dec 18 '15
74
u/Mmarco94 Dec 18 '15 edited Dec 18 '15
Created using 0 array, 2 variables (int) and only the main
Ex. 1: print a beautiful Christmas tree
Ex. 2: tic tac toe (against a "powerful" IA)
101
u/CJKay93 Dec 18 '15
_ % __
u wot
11
u/Mmarco94 Dec 19 '15 edited Dec 19 '15
Day 2:
I've made it shittier: http://pastebin.com/iLGBWtcY
Now, instead of comparing
_with 300 different numbers, I've hardcoded a binary search that does that. That was necessary for some reasons. (The differences are on lines 57, 60 and 63)42
u/bringeroflefaceface Dec 18 '15
I hope you generated those numbers
30
u/jana007 Dec 18 '15 edited Dec 18 '15
Jesus, and with their grading policy you're going to still get a *passing grade.
27
u/gnutrino Dec 18 '15
B-
Needs more preprocessor abuse
18
u/ClemmyN23 Dec 18 '15
This is brilliant!
Reckon you can get the compiled assembly code up with the optimiser -O flag on? Curious as to whether the compiler can do anything with this.
12
u/my_stacking_username Dec 18 '15
Can someone explain what is actually happening here
6
u/[deleted] Dec 19 '15
yo i tried to enter 0,1 as my coords and it fucking is dying.
what have you done bby boi
http://puu.sh/m0VGv/31914e9620.png
5
u/nihlius Dec 18 '15
Are you me? This is atrocious. <3 it
13
u/Reverend_Jones Dec 18 '15
what the fuck
13
u/combatdave Dec 18 '15
/r/deftruefalse would welcome you with open arms.
8
u/outadoc Dec 18 '15
You're a fucking monster
4
u/Cienzz Dec 18 '15
beautiful
3
u/[deleted] Dec 18 '15
This is amazing
3
u/[deleted] Jan 07 '16
int _=0,__;Today I learned you can have incredibly fucking stupid variable names in C.
2
u/GYN-k4H-Q3z-75B Dec 18 '15
I love it!
2
u/HoldMyWater Dec 19 '15
I skimmed through it. Very good. Readable, easy to understand... 10/10
2
u/Agent_Cookie Dec 20 '15
I've seen worse.
1
u/dynoraptor Dec 19 '15
Such elegance
1
u/[deleted] Dec 26 '15
http://www.ioccc.org/
1
u/Derp128 Dec 18 '15
You monster
-7
u/[deleted] Dec 18 '15
Sorry for anyone I downvote in this thread, it's probably because I upvoted the person above you and needed to keep the curly braces balanced
0
u/[deleted] Dec 18 '15
[deleted] — view deleted comment