typedef struct {struct {int x,y;} block[4];} piece;
piece deck[7]={{{{4,0},{5,0},{6,0},{7,0}}},{{{4,0},{5,0},{6,0},{4,1}}},{{{4,0},{5,0},{6,0},{5,1}}},{{{4,0},{5,0},{6,0},{6,1}}},{{{6,0},{5,0},{5,1},{4,1}}},{{{4,0},{5,0},{5,1},{6,1}}},{{{4,0},{5,0},{5,1},{4,1}}}};
//ILTJSZO
Do you think it could be longer? ;)
The longest initializer ever!
Started by Aereshaa, Dec 18 2009 01:34 PM
4 replies to this topic
#1
Posted 18 December 2009 - 01:34 PM
Check out this initializer from my tetris implementation:
|
|
|
#2
Posted 19 December 2009 - 02:08 PM
I reckon perhaps, if you expand to 3D tetris.
Enjoy
Enjoy
#3
Posted 22 December 2009 - 04:31 PM
Dude...this is horrendous. At least break it up a bit:
typedef struct {
struct {
int x, y;
} block[4];
} piece;
piece deck[7]={
{
{
{4,0},
{5,0},
{6,0},
{7,0}
}
},
{
{
{4,0},
{5,0},
{6,0},
{4,1}
}
},
{
{
{4,0},
{5,0},
{6,0},
{5,1}
}
},
{
{
{4,0},
{5,0},
{6,0},
{6,1}
}
},
{
{
{6,0},
{5,0},
{5,1},
{4,1}
}
},
{
{
{4,0},
{5,0},
{5,1},
{6,1}
}
},
{
{
{4,0},
{5,0},
{5,1},
{4,1}
}
}
};
sudo rm -rf /
#4
Posted 22 December 2009 - 05:11 PM
While there is no law that forbit you from doing that, your professor / boss will fail you with that code you have in the first place.
What is the very first rule of software engineering?
1. Readability
LOL
What is the very first rule of software engineering?
1. Readability
LOL
#5
Posted 22 December 2009 - 05:16 PM


Sign In
Create Account


Back to top









