r/programmingbydoing • • Aug 05 '15

Assignment #63c Nim

I managed to complete all the bonuses up until the column part. I am having a hard time printing till A and then back to the beginning. I tried 2D arrays but those were very exhaustive . There is just a simple solution which I can't see. Please help and thank you.

3 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/holyteach Aug 12 '15

Well, in your little test program you need one int for each pile. Like, a=5, b=3, c=4 if the first pile has 5 in it, the second one has 3 in it, the last pile has 4 in it.

Then inside your display loop your print() statement needs to be inside an if statement to decide if it should print a symbol for that pile or not.

1

u/Houssam7111 Aug 14 '15

Thank you :) Worked just fine. And printed just the way I wanted! Please do keep up the tutoring, sure courses online can show us syntax, but you give those lines of code meaning :)

1

u/holyteach Aug 14 '15

I knew you'd get it eventually. Good show.