r/codehs • • Apr 04 '21

APCSA Nitro 9.1.8: Computers

5 Upvotes

I'm really stuck on 9.1.8: Computers. Could anyone help me?


r/codehs • • Mar 06 '21

3.2.2 Tower Builder: Every world works except for #4

5 Upvotes

Can you help? My daughter is freaking out and I don't know how to help her.


r/codehs • • Feb 11 '21

2.17.4: Super Cleanup Karel

5 Upvotes

Hi all, Can I get help on this, I've been stuck on this for a week.


r/codehs • • Jan 27 '21

Java 7.3.6 Traversiny Odds. Its not properly printing the odd numbers as well as i dont know why is has a [] and a , — and also how do i test it in the console.. can someone explain it. Thank you

Post image
5 Upvotes

r/codehs • • Jan 25 '21

Can anyone help me with the tic tac toe project, I can't figure out how to determine the winner and how to create the red line to signify the winner of the game?

5 Upvotes

If you can help please reply or message me it is greatly appreciated if you have any tips!!


r/codehs • • Jan 19 '21

Python 7.6.10: Part 2, Remove All From String

5 Upvotes

Thought my logic was correct, other posts and websites said this was right as well.

def remove_all_from_string(word, seg):

 while True:
      x = word.find(seg)

     If x == -1:
        break
  else:
      word = word [:x] + word[x + len(seg):]
  return word

print(remove_all_from_string("bananas", "na"))


r/codehs • • Jan 17 '21

For 7.7.4 it says the output doesn’t match the solution

Post image
5 Upvotes

r/codehs • • Dec 27 '20

Python Need helpwith 7.5.5 python: contains a vowel

5 Upvotes

I wrote the code, and it works fine, but whenever I press submit, it just infinitely loads and doesnt submit. Please help!

Code:

contains_vowel = "aeiou"

user_string = input ("Enter a lowercase string: ")

result = "Doesn't contain a lowercase vowel."

for c in user_string:

if c in contains_vowel:

result = "Contains a lowercase vowel!"

break

print (result)


r/codehs • • Dec 26 '20

CodeHS: Final Project

5 Upvotes

Hello, I want to make a snake game I teach the snake how to move, but I can't work out how it can eat an apple. I know I have to use getElementAt operator, but I don't know how.

please help me!


r/codehs • • Dec 07 '20

Java 2.9.11 Need Help

Post image
5 Upvotes

r/codehs • • Nov 19 '20

Can someone help me with 5.2.8 SchoolClub Codehs. I don't know what I did wrong.

5 Upvotes

r/codehs • • Aug 15 '20

Python 5.3.8 infinite loop

5 Upvotes

I have a loop problem I can't figure out, the problem is -

Write a program that makes the user guess a particular float. Now, recall that you should not compare floats to determine if they are exactly equal. In this program, the user wins if their guess is accurate to within 2 decimal places. You will have to use round
in your comparison of their guess to your number.

If the user’s guess was too high, you should say so. Similarly, you should tell them if their guess was too low.

and my code is -

and it runs correctly, but when I try and grade it the autograder acts like there's an infinite loop, does anyone see what would cause that?


r/codehs • • Jun 14 '20

Double Tennis Balls

5 Upvotes

Anyone one know how to do this? I keep getting stuck on the part where you have to put balls but match all the others to.


r/codehs • • Jun 03 '20

8.3.6 Owls

5 Upvotes

Can someone help me with this code. I have no idea what to do. Thanks.


r/codehs • • May 23 '20

My collision function doesnt work!

5 Upvotes

this my code for final project, but i dont get why intersection and checkcollision functions doesnt work.

please someone help!

var char;

var bullet;

var enemy;

var life = 5;

var enemyTimer = Randomizer.nextInt(0,50);

var enemies = [];

function start(){

makeChar();

keyDownMethod(movements);

makeBullet();

setTimer(shootBullet, 30);

addEnemy();

setTimer(makeEnemy, 5);

checkCollision();

}

function makeChar(){

char = new Circle(10);

char.setColor(Color.red);

char.setPosition(getWidth()/2, 430);

add(char);

}

function movements(e){

if (e.keyCode == Keyboard.RIGHT){

char.move(10,0);

}

if (e.keyCode == Keyboard.LEFT){

char.move(-10,0);

}

}

function makeBullet(){

bullet = new Rectangle(5,10);

bullet.setPosition(char.getX(), char.getY());

bullet.setColor(Color.green);

add(bullet);

}

function shootBullet(){

bullet.move(0,-10);

if (bullet.getY() < 0){

bullet.setPosition(char.getX(), char.getY());

}

}

function makeEnemy(){

for (var i = 0; i < enemies.length; i ++){

var b = enemies[i];

b.move(0,5)

b.move(Randomizer.nextInt(-3,3),0);

}

}

function addEnemy(){

setTimer(en,800);

}

function en(){

enemy = new Rectangle(50,50);

var x = Randomizer.nextInt(10, 350);

var y = enemy.getY();

y += 10;

enemy.setPosition(x,y);

add(enemy);

enemies.push(enemy);

}

function intersects(a,b){

return (a.getX() < b.getX() + b.getWidth() && a.getX() + a.getWidth > b.getX() && a.getY() < b.getY() + b.getHeight() && a.getY() + a.getHeight > b.getY());

}

function checkCollision(){

for(var i =0; i < enemies.length; i++){

var en = enemies[i];

if (intersects(char, en)){

println("hi");

remove(en);

i--;

remove(bullet);

}

}

}


r/codehs • • May 22 '20

Idk know why it says that I am not comparing the two rounded variables

Post image
5 Upvotes

r/codehs • • Apr 30 '20

I have to make a method to replace the last value in the 2D array and I keep getting these errors by the way this is 8.1.5 manipulating 2D arrays

Post image
5 Upvotes

r/codehs • • Mar 07 '20

Hello, this is 9.2.6 Paint Splatter can you please help me??

5 Upvotes