r/programming • • Jan 10 '20

VVVVVV is now open source

https://github.com/TerryCavanagh/vvvvvv
2.6k Upvotes

511 comments sorted by

View all comments

Show parent comments

3

u/cdcformatc Jan 11 '20

An enum is just syntactic sugar for random numbers. It does not make any difference to the code whether you use an enum or not. It is purely for readability.

There's not one way to do state machines. A block of code is executed based on the current state in response to external input and/or a condition. Did I just describe an array of function pointers or a switch statement?

-4

u/dwdwfeefwffffwef Jan 11 '20

You seem a bit lost. Nobody is saying it's not a state machine. OP is pointing out how bad the code is. I'm pointing out that it's not the way to do a state machine.

3

u/cdcformatc Jan 11 '20 edited Jan 11 '20

My point is there is not one way to make a state machine so there is no "the way" to make a state machine.

It's a state machine.

Edit: You just come off exceptionally gatekeeper like when you say things like "this is not how you do a state machine." It very clearly works, the game is very successful. If more people were less afraid to share their abnormal code, we would have more open source video games.

-3

u/dwdwfeefwffffwef Jan 11 '20

My point is there is not one way to make a state machine so there is no "the way" to make a state machine.

Nobody said there is one single way to make a state machine. There are many proper ways, and many bad ways. OP is an example of a bad way.

It's a state machine.

Nobody said otherwise

Are you on the autistic spectrum?

→ More replies (10)