Rating... - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Rating...

Marc LorenzMarc Lorenz Posts: 25Member
Can you rate this from 1-10, 10 being the highest. And tell me if it can be easily understood by other people. Thanks.

// Ask user what difficulty to play
// If difficulty is 1 THEN
Draw 9(3x3) boxes
// If difficulty is 2 THEN
Draw 16(4x4) boxes
// If difficulty is 3
Draw 25(5x5) boxes THEN
// END IF

// Set the value of all indices of array v to zero
// Put values 0-x(depending on difficulty) randomly on array v
// Print the values in array v on top of the boxes
// IF value is zero THEN
// Draw a blank box on top of box zero
// END IF

// WHILE user still wants to play

// WHILE user isn't done arranging the boxes in numerical order

// CASE controller OF
up : swap blank box and the box below it
down : swap blank box and the above below it
left : swap blank box and the rightside box
right : swap blank box and the leftside box
esc : end the program
r : reset the game
// ENDCASE

// IF user is done arranging the boxes in numerical order
THEN
// Ask user to play again
// IF answer is yes THEN
// reset the game
// ELSE
// end the program
// END IF

// END WHILE

// END WHILE

Comments

  • LundinLundin Posts: 3,711Member
    : Can you rate this from 1-10, 10 being the highest. And tell me if it can be easily understood by other people. Thanks.
    :
    : // Ask user what difficulty to play
    : // If difficulty is 1 THEN
    : Draw 9(3x3) boxes
    : // If difficulty is 2 THEN
    : Draw 16(4x4) boxes
    : // If difficulty is 3
    : Draw 25(5x5) boxes THEN
    : // END IF
    :
    : // Set the value of all indices of array v to zero
    : // Put values 0-x(depending on difficulty) randomly on array v
    : // Print the values in array v on top of the boxes
    : // IF value is zero THEN
    : // Draw a blank box on top of box zero
    : // END IF
    :
    : // WHILE user still wants to play
    :
    : // WHILE user isn't done arranging the boxes in numerical order
    :
    : // CASE controller OF
    : up : swap blank box and the box below it
    : down : swap blank box and the above below it
    : left : swap blank box and the rightside box
    : right : swap blank box and the leftside box
    : esc : end the program
    : r : reset the game
    : // ENDCASE
    :
    : // IF user is done arranging the boxes in numerical order
    : THEN
    : // Ask user to play again
    : // IF answer is yes THEN
    : // reset the game
    : // ELSE
    : // end the program
    : // END IF
    :
    : // END WHILE
    :
    : // END WHILE
    :


    Seems pretty clear to me, apart from a few minor typos and such. But then I'm a programmer and not "other people" :-) A person who isn't used to reading pseudo code might find it difficult to understand, I suppose.
  • Marc LorenzMarc Lorenz Posts: 25Member
    Seems pretty clear to me, apart from a few minor typos and such. But then I'm a programmer and not "other people" :-) A person who isn't used to reading pseudo code might find it difficult to understand, I suppose.


    Well it's my teacher who's going to read it so i guess it's ok. I'll try to make it better.
    Thanks again. :-)
Sign In or Register to comment.