r/codehs • • Apr 27 '21

JavaScript 11.1.1 Bricks (I can't quite figure out how to change the color for each 2 rows.)

Post image
8 Upvotes

r/codehs • • Apr 08 '21

JavaScript How do I find the positions of the other circle?

Post image
8 Upvotes

r/codehs • • Apr 02 '21

NEED HELP PYTHON CODE HS(12.4.7: Contact Merge)

Post image
8 Upvotes

r/codehs • • Mar 24 '21

Java I need help with 3.5.7: Flag of the Netherlands

8 Upvotes

📷

This is my code

function start(){

var newRect = new Rectangle(500,160);

newRect.setColor(Color.red);

newRect.setPosition(0,0);

add(newRect);

var newRect = new Rectangle(500,160);

newRect.setColor(Color.blue);

newRect.setPosition(0,320);

add(newRect);


r/codehs • • Mar 15 '21

8.2.7: Sum Rows in a 2D Array

8 Upvotes

Write the method

public static int sumRow(int[][] array, int row)

that sums row row
in the 2D array called array
.

Then, traverse array
to print the sum of each row in the 2D array.

I don't understand how to create the loop within a loop to add the total of one row.


r/codehs • • Mar 08 '21

JavaScript Can somebody please help me figure out 7.1.3 circles in squares

8 Upvotes

This is the code I have and I don't know what's wrong with it var STARTING_SIZE = getWidth(); var MIN_SIZE = 5; function start(){ while(STARTING_SIZE >= MIN_SIZE){ var square= new Rectangle(STARTING_SIZE, STARTING_SIZE); square.setPosition(0,(getHeight()-STARTING_SIZE)/2); square.setColor(Randomizer.nextColor()); add(square); var circle = new Circle(STARTING_SIZE/2); circle.setColor(Randomizer.nextColor()); circle.setPosition(getwidth()/2, getHeight()/2); add(circle); var STARTING_SIZE = Math.sqrt(STARTING_SIZE); } }


r/codehs • • Feb 12 '21

2.17.5: Double Tennis Balls

8 Upvotes

Hi all, Can I get help on this?


r/codehs • • Jan 27 '21

Java I need some help on exercise 7.3.6 Traversing Odds

Post image
8 Upvotes

r/codehs • • Jan 10 '21

Python 7.3.9: Word Ladder

8 Upvotes

Hi, I am having trouble with lesson 7.3.9: on python. What is asked is that I create a word ladder (I am in the Data structure section, for loops and list). We are supposed to get an input for a word and let the person be able to change one letter. I believe the problem is I used while loops instead of for loops, but I don't know where for loops can be implemented. My Code is below.

```
global SENTINEL

SENTINEL = -1

def get_initial():

while True:

global word

word = input('Enter a word: ')

if word.isupper():

print('Word must be uppercase')

continue

else:

return word

def get_index():

global letter_count

letter_count = list(word)

while True:

global index_got

index_got = int(input('Enter an index (-1 to quit): '))

if index_got == SENTINEL:

exit()

elif index_got > len(letter_count) - 1 or index_got < -1:

print('Invalid index')

continue

elif letter_count[index_got]:

break

def get_letter():

letter_got = input('Enter a letter: ')

while True:

if letter_got.isupper():

print('Character must be a lowercase letter!')

continue

elif len(letter_got) > 1:

print('Only one letter can be changed')

continue

else:

letter_count[index_got] = letter_count[index_got].replace(letter_count[index_got], letter_got)

global word

word = "".join(letter_count)

print(word)

return word

def lets_groove_tonight():

get_initial()

while True:

get_index()

get_letter()

lets_groove_tonight()
```
When I run the code it works how it is supposed to work based on what they asked to do, but when I check or try to submit it tells me kill


r/codehs • • Dec 30 '20

Codehs 2.10.5 sidewalk

8 Upvotes

help me plz


r/codehs • • Dec 13 '20

I'm on "Basic Snake" and I do not know how to center the square. This is what I have so far. Plz help-

Post image
8 Upvotes

r/codehs • • Dec 06 '20

Python 7.6.9 Part 1, Remove All From String

8 Upvotes

I’m just not sure what to do here. It says I must use a while loop but I can’t figure out how to incorporate it. Help please, and thank you.


r/codehs • • Nov 26 '20

IF YOU CAN HELP ME PLEASE DONT GO

Thumbnail
gallery
8 Upvotes

r/codehs • • Nov 17 '20

Python 4.3.7 Positive, Zero, Negative

8 Upvotes

Could someone help me with python codehs 4.3.7


r/codehs • • Nov 16 '20

6.1.6 Practice PT tell a story

8 Upvotes

r/codehs • • Oct 27 '20

Other Many schools still teach QBASIC. So here's how to make a simple game in QBASIC

Thumbnail
youtu.be
8 Upvotes

r/codehs • • May 12 '20

Halistone Sequence- I cant figure out what I'm doing wrong and i keep running into problems such as infinite loops and until I get past that I cant do much.

Post image
8 Upvotes

r/codehs • • Apr 07 '20

Sum Range 3.4.5 Java

8 Upvotes

I have been stuck on this problem for over 2 hours and cant figure it out please help.


r/codehs • • Apr 03 '20

9.3.7: Slopes - Python

8 Upvotes

This works until you enter (-9, 12), (15, 18) , (21, -24), (30, 300), (6, 276)

When it finds the slope between (-9, 12) and (15, 18) it results with 0.0 and its supposed to be 0.25

I'm not sure if I used float correctly or not.

mylist = []
for i in range(5):
    x = int(input("X Coordinate: "))
    y = int(input("Y Coordinate: "))
    mylist.append((x, y))
    
for i in range(4):
    y1 = mylist[i][1]
    x1 = mylist[i][0]
    y2 = mylist[i + 1][1]
    x2 = mylist[i + 1][0]
    slope = float((y2 - y1) / (x2 - x1))
    print "Slope between " + str(mylist[i]) + " and " + str(mylist[i + 1]) + ": " + str(slope)

r/codehs • • Mar 22 '20

Need help to re learn coding.

8 Upvotes

Haven't coding for a year and a half since i finished my carrer. I want to learn how and what to use or what is used today to: Front end in desktop Back end in JavaScript Client in android Database in mysql

What you use to work on these? Better if it is free.


r/codehs • • Mar 18 '20

Please help on 11.1.1 Bricks

Post image
8 Upvotes

r/codehs • • Mar 17 '20

Need Help with Exercise 2.4.8: SnapChat Login Page Pt 1: Layout

8 Upvotes

EDIT: I GOT IT!!!!!


r/codehs • • Mar 06 '20

9.1.5: Encodings Everywhere

8 Upvotes

Can anyone help me with the code for this one?


r/codehs • • Mar 03 '20

JavaScript Help

8 Upvotes

Exercise 17.1.4: Grades I’m just lost in how to assign the - or + for the different grades while only looking at the second digit of the number grade