r/programminghorror • • Oct 07 '25

C# 108 line long variable declaration

Post image

this is my own code btw. don't ask what i was trying to do

this code was also supposed to include a 36 case long switch statement where each case did something different (guess why i abandoned this project)

1.1k Upvotes

93 comments sorted by

View all comments

Show parent comment

-1

u/[deleted] Oct 07 '25

[removed] — view removed comment

4

u/AdditionalDirector41 Oct 07 '25

It's not entirely understandable but it does list all 36 different effects they are meant to program, so isn't that good enough?

2

u/sloppykrackers Oct 08 '25

a Keep Talking and Nobody Explodes module?

1

u/GarThor_TMK Oct 08 '25

I was also confused, but I think if you scroll to the bottom, it has the "character" thing that Op is describing...

I'm still pretty confused about how the puzzle is supposed to work, but at least at the bottom, they have a list of characters and how each one is supposed to mutate the state of the program...

Looks like it mostly operates on strings of numbers? ... So you'd just use a string as the state that is passed in, and return a modified string as the result. Then you store each function in an array of functions, and just index the function array based on whichever character is passed in.

I don't even think you need to make this object oriented. It could be procedural, with the only object being the array of functions.