4 ms·
Any language with goto, and skip any notion of structured programming elements except if-statements, including all methods or functions except for main or its e
by Jtsummers 5y ago
Any language with goto, and skip any notion of structured programming elements except if-statements, including all methods or functions except for main or its equivalent if required. Only make function calls to library functions that you can't get to any other way. if is permitted so that you can have conditional jumps. Bonus points for Fortran and computed gotos. Like this (in pseudocode):
start:
x = read(); // hope its a number
goto x;
10: ...
20: ...
30: ...
goto start;
If you aren't using goto and labels, it's not spaghetti code.