r/visualbasic • • Jan 12 '20

Need a bit help

So ive done a program and my teacher just casually said its spagheti code and i need to somehow fix it but im totally out of idea how to do that so i would appreciate all help i can get from here!
Here is the code:
https://pastebin.com/qzPbMXh8

6 Upvotes

33 comments sorted by

View all comments

Show parent comments

1

u/Dennis13631 Jan 12 '20

But to be honest we still havent learned that setcursorposition so not sure how it works completly i just found it while browsing to get my job done :D

1

u/LondonPilot Jan 12 '20

So, finding things while browsing is not a problem at all, it’s something professionals do all the time! It’s not something I’d necessarily expect a beginner to do, but it’s something I encourage my beginners to start doing after a week or two of intense training, so I think it’s great that you’re doing that!

There is another way of doing it though, if you prefer. You could do all of the top line of each character first. Use Console.Write() instead of Console.WriteLine(), so that each piece of text comes next to the previous one, instead of below it, and then use Console.WriteLine() with no arguments in the brackets to move onto the next line and start drawing the second line of each character. Put that in a For loop to repeat it the correct number of times for each line.

Personally, I think the SetCursorPosition() technique is easier, but if you think this technique is easier then feel free to give it a go. Make a backup of what you’ve done so far first, though, in case it goes wrong, because you’ll have to rework a lot of what you’ve done already.

2

u/Dennis13631 Jan 13 '20

Hey man just wanted to let u know i have finally finished the job! Here is the final look https://imgur.com/a/n2iHh7p
I did it with the setcursorposition. Couldnt think of other way or find anything else in google :D

1

u/LondonPilot Jan 13 '20

Nice work!

That feeling you get when you've struggled with something, then finally figure it out - it's a good feeling isn't it!

1

u/Dennis13631 Jan 13 '20

its an awesome feeling!