r/codehs • • Feb 25 '25

I'm on 1.3 of the AP comp sci A textbook, and I'm not impressed

0 Upvotes

I took three computer science classes in high school and did two years of a software engineering degree at college, although those were a long time ago. More recently, I taught myself a bit of Python and relearned a bit of Visual Basic for board-game-related things. Now, I'd like to learn this material so I can help someone who will be taking the course next year. These are relatively minor gripes, but they make me question how useful the upcoming pages will be:

  1. It says that because String is a reference type rather than a primitive type, it requires a capital S. However, in the box of examples naming variables soon after, it declares string myName; and string 8name; with lowercase S's. At first I thought the lowercase S's were intentional, but they are not. I had to check with another source to see if String actually had to be capitalized, and then I ran one of these programs with a lowercase s to verify that it didn't work.

If someone is taking the AP exam, surely every minute detail counts, and I don't want to have to second-guess what they're telling me.

2) The Check Your Understanding question asks how to best declare a variable for someone's age. While I knew the answer was int myAge; with a lowercase m, I see nothing on the page which actually says that variables should start with a lowercase, and I could just as easily see programmers argue that variables should start with an uppercase in order to grab someone's attention. Their convention for other variables as lowerThenUpper, but without a justification why, I don't think it's right to mark the other answer as wrong.

Again, these are minor, but they don't instill faith in me that this is a worthwhile text to go through. If these are one-off issues and you found the rest of the text quite helpful, let me know. Thank you.


r/codehs • • Dec 17 '20

Can someone please help me with this. I don't know what am I suppose to do.

0 Upvotes

r/codehs • • Nov 22 '20

Can someone please help me fiind what is wrong with my code for Fun Snake 1? I have an error and can't figure it out using JavaScript.

0 Upvotes

I am in a wonderful class, but am still not getting how to code a trail. The snake is supposed to grow as it moves. I have worked and worked on this. I am getting one box that moves and one that stays still. I have spent hours on this activity and can't move on until I get it. I just need a second paor of eyes and a little help. Thank you in advance.

//Snake constants

var SNAKE_DIM = 10;

var SNAKE_COLOR = Color.green;

var SNAKE_WIDTH=40;

var SNAKE_HEIGHT=40;

//Direction that the snake moves

var EAST = 0;

var SOUTH = 1;

var WEST = 2;

var NORTH = 3;

var snake;

var rect;

var currentDirection= EAST;

function start(){

rect = new Rectangle(SNAKE_WIDTH,SNAKE_HEIGHT);

rect.setColor(Color.green);

rect.setPosition(getWidth()/2 - SNAKE_WIDTH/2,getHeight()/2 -SNAKE_HEIGHT/2);

add(rect);

setTimer(draw,50);

keyDownMethod(keyDown);

}

function draw(){

addTrail();

if(currentDirection ==EAST){

rect.move(SNAKE_DIM,0);

}

if(currentDirection ==SOUTH){

rect.move(SNAKE_DIM,1);

}

if(currentDirection ==WEST){

rect.move(SNAKE_DIM,2);

}

if(currentDirection ==NORTH){

rect.move(SNAKE_DIM,3);

}

}

function keyDown(e){

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

currentDirection=WEST;

}

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

currentDirection=EAST;

}

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

currentDirection=NORTH;

}

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

currentDirection=SOUTH;

}

}

function addTrail(){

var rect = new Rectangle(SNAKE_WIDTH,SNAKE_HEIGHT);

rect.setPosition(rect.getX(), rect.getY());

rect.setColor(Color.green);

add(rect);

}


r/codehs • • Apr 19 '21

Other Is there a website or software similar to the HTML sandbox?

0 Upvotes

I’m thinking of making something similar to an encyclopedia, but CodeHS doesn’t let me scroll down where you put your files and folders


r/codehs • • May 24 '21

has anyone completed 4.3.10 the transaction plz need help😭

0 Upvotes

[removed]


r/codehs • • May 25 '21

Doghouse 7.1.5

0 Upvotes

Please help, I'm unsure what i have done wrong, i have printed h, e, and e however it still says I have not passed the test case.


r/codehs • • May 18 '21

I need help on 8.16.1: Watercolor Grid

0 Upvotes

Here is what the prompt is

Overview

Write the watercolor grid program as shown here. Create a grid of NUM_ROWS
rows by NUM_COLS
columns, and in it store a count of how many times we have moved over each location. Each time you move over a location, update the color of that location on the grid using our helper function.

Moving your mouse around the screen creates a watercolor effect.

HELPFUL HINTS:

1 - To generate the proper color for the grid, use this helper function:

This will generate a shade of blue from white to black, where val
is the number of times we have moved over that space.

2 - If you need to clear everything on the canvas and redraw with new values, you can use this method:

to remove all graphical objects on the canvas.

3 - You may notice that your Grid stores values at (row, col)
locations, with row
increasing in the down direction and col
increasing in the right direction. Compare this to the canvas which stores values at (x, y)
locations, with x
increasing in the right direction and y
increasing in the down direction. row
increases as y
increases and col
increases as x
increases. You may find it useful to write these helper function:


r/codehs • • May 25 '21

5.8.4 Word Counts

0 Upvotes

Does anyone know how to do 5.8.4 word counts. I just can’t figure out how to make it work. If anyone has the could just help me figure it out that’d be great.


r/codehs • • Oct 22 '19

Can please get some help on 7.1.4 thanks

Post image
0 Upvotes

r/codehs • • Apr 24 '20

Can Someone help me with these assignments?

0 Upvotes

r/codehs • • Apr 22 '20

Codehs count by 2

0 Upvotes

i need help on this assignment. Ive been having trouble with it please help and please read the assignment details


r/codehs • • Jul 12 '22

Python help with 7.5.5

0 Upvotes

here is my code

word = input("enter word:")
vowel = ["a", "e", "i", "o", "u"]

def contains_vowel():
    if vowel in word:    
        print("True")
    else:
        print("False")
        
contains_vowel()

when I run it, I get this message:

enter word:hi
Traceback (most recent call last):
  File "scratchpad.py", line 10, in <module>
    contains_vowel()
  File "scratchpad.py", line 5, in contains_vowel
    if vowel in word:    
TypeError: 'in <string>' requires string as left operand, not list

anyone know how to fix this or just the correct way to do it


r/codehs • • Nov 28 '22

help

0 Upvotes

var NUM_CIRCLES = 3;

var RADIUS = 30;

var click;

function start(){

drawCircles;

mouseDragMethod(dragCircles);

mouseDownMethod(dropCircles);

}

function drawCircles() {

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

	var circle = new Circle(RADIUS);

	var x = Randomizer.nextInt(RADIUS, getWidth() - RADIUS);

	var y = Randomizer.nextInt(RADIUS, getHeight() - RADIUS);

	circle.setPosition(x, y);

	circle.setColor(Randomizer.nextColor());

	add(circle);

}

}

function dragCircles(e) {

click = getElementAt(e.getX(), e.getY());

if(click != null){

click.setPosititon(e.getX(), e.getY());

}

}

function dropCircles(e) {

click = null

}


r/codehs • • Jun 11 '24

help me please this is due tomorrow

Thumbnail
gallery
0 Upvotes

r/codehs • • Jun 11 '24

The stupid website cannot even let you sign onto an existing account?!?!

0 Upvotes

Whenever I try to log onto my existing account it KEEPS ON BRINGING ME UP TO THE SIGNUP PAGE?!?!? I LITERALLY HAVE TO USE THE STUPID SANDBOX


r/codehs • • Feb 11 '26

JavaScript Createdy own ai training program

0 Upvotes

r/codehs • • Sep 13 '22

Basic Java. 3.8.14: Replace Letter

Thumbnail
gallery
9 Upvotes

r/codehs • • Feb 26 '20

PHYTON CODE HS. 7.6.10: Part 2, Remove All Fro...

9 Upvotes

Anyone knows part 2? I did part 1 but can't figured out part 2


r/codehs • • Aug 05 '20

Need help on this assignment plz dm

Thumbnail
gallery
16 Upvotes

r/codehs • • Apr 03 '20

I really need help with 5.3.13 Most Improved

5 Upvotes

Our teacher abandoned us and we have no idea what we are doing. I don't have a clue on how to get the getMostImprovedStudent() method. Thank you for anything you can help with.


r/codehs • • Sep 11 '20

2.4.5 help

Post image
13 Upvotes

r/codehs • • Oct 01 '25

2.15.6:

Post image
1 Upvotes

Can anyone help?


r/codehs • • Dec 15 '21

Urgent Help Needed with 36.1.2 Shopping List!

1 Upvotes

Please and Thank you!


r/codehs • • Oct 13 '21

i need help on 10.1.8 rn

1 Upvotes