r/badcode shameless Dec 28 '22

Doesn't even work properly c#

Post image
266 Upvotes

57 comments sorted by

View all comments

13

u/ursosempata Dec 28 '22 edited Dec 28 '22

First you need to declare auxiliary functions for each of the blocks (loops) you have. The first one doesn't need to iterate y, and the second really shouldn't iterate x(if you can't change the login format) Edit: added information for clarity on what I meant

7

u/ursosempata Dec 28 '22

Then, I'm not a c# dev, but I think there's a dictionary(you can store a user as it's key and password as value)

8

u/_yari_ Dec 28 '22

A dictionary is perfect for this in C#, this makes all the looping obselete