Questions tagged [nested-loops]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
2answers
111 views

Mario counter and output problem

I think I have a problem with the syntax of my main loop that counts the number of lines to output. When I set the counter = 1, it prints the correct number of rows but starts at the top with only 1 ...
0
votes
3answers
90 views

Pset3 - Multiple nested if statements

I have been working on the pset3 Breakout problem, and find myself using many nested IF statements, specifically for the creation of the blocks, and the assigning of points based on where the block is ...
0
votes
1answer
334 views

So Close on Mario Pyramid

I've finally gotten some loops nesting properly and building a type of pyramid. I'm not sure where I've gone wrong that the hashes are repeating a few times on the same line and the spaces (rendered ...
0
votes
2answers
165 views

what is the significance of break; in tabulate function?

I know break statements are pretty basic, but it's got me here: This is my function: for (int i = 0; i < voter_count; i++) { for (int j = 0; j < candidate_count; j++) { if (...
0
votes
1answer
245 views

How to initiate bricks in pset3 breakout game?

I can't copy the code from VMWare to Windows, so I took a screenshot: http://i.imgur.com/lKM8EgE.jpg What am I doing wrong? I think my logic is correct and my code should work. I get this output: ...
0
votes
1answer
392 views

Loop breaking in quick sort algorithm

Implement quick sort algorithm with faulty results. Details of what I want to do can be found at the video: https://courses.edx.org/courses/course-v1:HarvardX+CS50+X/courseware/...
0
votes
1answer
72 views

pset1: difficulty with hash algorithm

I've been working on Mario for a week now. I have found a pattern to create the spaces (which I am replacing with underscores just to see how my code outputs) but they are not printing at all. I ...
-1
votes
1answer
531 views

How to break out of nested for loops

I would like to stop only the nested for loop, not the do while loop, in the following code. I have tried all the possible positions of break without success. do { draw(d); printf("tile to ...