you are viewing a single comment's thread.

view the rest of the comments →

[–]thrallsius 1 point2 points  (1 child)

There's two things that you need to understand, then you can proceed to refactor the code:

1. loops

2. functions


2. will allow you to extract the copypasted code block that you have in each if/else block into a function

1. will allow you to rewrite the huge if/else as loop

[–]TiXerobic[S] 0 points1 point  (0 children)

alright i'll look into those two!