Questions tagged [nested-loops]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
242 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 (...
Musical_Ant's user avatar
0 votes
1 answer
455 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/...
Marcello Scattolini's user avatar
0 votes
1 answer
82 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 ...
Lee Gainer's user avatar
0 votes
3 answers
91 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 ...
Annemarie's user avatar
0 votes
1 answer
396 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 ...
Marin Fernald's user avatar
0 votes
1 answer
247 views

How to initiate bricks in pset3 breakout game?

I can't copy the code from VMWare to Windows, so I took a screenshot: https://i.stack.imgur.com/jrqh3.jpg What am I doing wrong? I think my logic is correct and my code should work. I get this ...
rohan's user avatar
  • 23
1 vote
2 answers
128 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 ...
Brian T's user avatar
  • 53
-1 votes
1 answer
660 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 ...
pavlos romios's user avatar