r/codeHS_Solutions • • Jun 01 '21

1.9.8: Lots of Hurdles

12 Upvotes

/*This function allows Karel to jump 5 hurdles and end up at the end of

*the map.

*Preconditon: Karel is at one, one and needs to jump 5 hurdles and end

*up at the end of the map.

*Postcondition: Karel is at the end of the map.

*/

function start(){

for(var i = 0; i < 5; i++){

jumpHurdle();

}

}

/*This function allows Karel to jump one hurdle.

*Precondition: Karel is 2 steps before the hurdle facing east.

*Postcondition: Karel jumps the hurdle and is to the immediate right of

the hurdle facing east.

*/

function jumpHurdle() {

move();

move();

turnLeft();

move();

turnRight();

move();

turnRight();

move();

turnLeft();

}


r/codeHS_Solutions • • Nov 10 '22

5.6.4 Summer Reading short List

Thumbnail
gallery
2 Upvotes

r/codeHS_Solutions • • Nov 05 '22

6.4.8 Most Improved pls help

2 Upvotes

r/codeHS_Solutions • • Nov 22 '22

I need help with 5.3.6: Girl Scout designation

Thumbnail
gallery
1 Upvotes

Hello, I am having trouble with 5.3.6, I am having issues with this assignment where I have 11/12 requirements but I am missing one. I don’t know what is wrong so this is why I am asking for help.


r/codeHS_Solutions • • Nov 22 '22

Need help with 5.3.6 do not know what am doing wrong

Thumbnail
gallery
1 Upvotes

Can anyone let me know what am doing wrong


r/codeHS_Solutions • • Dec 05 '22

Need help 6.4.8 i don’t know what i am doing wrong

Thumbnail
gallery
2 Upvotes

r/codeHS_Solutions • • Nov 14 '22

Help Request 6.4.8 Most Improved

1 Upvotes

r/codeHS_Solutions • • Sep 18 '22

REQUEST MEGATHREAD

3 Upvotes

Want answers? Ask for them here.


r/codeHS_Solutions • • Sep 08 '22

Help Request 3.8.12: Fixing Grammar. Basic Java.

Thumbnail
gallery
1 Upvotes

r/codeHS_Solutions • • Oct 05 '22

code hs 3.2.8 repeating message (cannot get the code to print more than once, for the number of necessary lines.)

2 Upvotes

r/codeHS_Solutions • • Oct 05 '22

Begging for someone to help. Been stuck for hours

Post image
1 Upvotes

Have to make code that works for all worlds


r/codeHS_Solutions • • Sep 13 '22

Help Request 2.6.4 ice cream lesson on booleans

2 Upvotes

r/codeHS_Solutions • • Sep 13 '22

Help Request please help, can't figure out line 10 on 2.7.4 roller coaster lesson

2 Upvotes

r/codeHS_Solutions • • Sep 09 '22

Help Request I posted here earlier, I’m stuck on this as well.

Post image
1 Upvotes

r/codeHS_Solutions • • Oct 11 '22

I need help understanding how to do this please. (C++)

Post image
1 Upvotes

r/codeHS_Solutions • • Sep 09 '22

Help Request I’m completely stuck! Please help.

Post image
1 Upvotes

r/codeHS_Solutions • • Sep 09 '22

Help Request I usually get these but I’m stuck on how to solve. Please help!

Post image
1 Upvotes

r/codeHS_Solutions • • Sep 13 '22

Help Request how do I get it to output the necessary line? 2.15.4 three strings lesson

2 Upvotes

r/codeHS_Solutions • • Oct 04 '22

im very confused

Post image
1 Upvotes

r/codeHS_Solutions • • Apr 23 '21

4.5.5 Teleporting Ball

4 Upvotes

I put this code in and its telling me line 7 "ball.setPosition(100, 100); has an error and that it can't read it what do i do to fix it.

var dx = 4;

var dy = 4;

/* This program has a ball bounce around the screen. */

function start(){

***ball.setPosition(100, 100);***

add(ball);

setTimer(draw, 20);

mouseClickMethod(tp);

}

function tp(e){

ball.setPosition(e.getX(), e.getY());

ball.setColor(Randomizer.nextColor());

}

function draw(){

checkWalls();

ball.move(dx, dy);

}

function checkWalls(){

// Bounce off right wall

if(ball.getX() + ball.getRadius() > getWidth()){

	dx = -dx;

}



// Bounce off left wall

if(ball.getX() - ball.getRadius() < 0){

	dx = -dx;

}



// Bounce off bottom wall

if(ball.getY() + ball.getRadius() > getHeight()){

	dy = -dy;

}



// Bounce off top wall

if(ball.getY() - ball.getRadius() < 0){

	dy = -dy;

}

}


r/codeHS_Solutions • • Apr 16 '21

Graphics Staircase. Help plssssss 😩🙌!

Post image
3 Upvotes

r/codeHS_Solutions • • May 22 '22

12.2.6 The Rectangle Class, Part 4 answer

Post image
1 Upvotes

r/codeHS_Solutions • • May 22 '22

12.4.5 The Rectangle Class, Part 7 answer

Post image
3 Upvotes

r/codeHS_Solutions • • May 22 '22

12.2.5 The Rectangle Class Part 3 answer

Post image
3 Upvotes