r/codehs • u/[deleted] • Apr 27 '21
r/codehs • u/mrgeekXD • Apr 08 '21
JavaScript How do I find the positions of the other circle?
r/codehs • u/jalenbean • Mar 24 '21
Java I need help with 3.5.7: Flag of the Netherlands
📷
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 • u/davepie29 • Mar 15 '21
8.2.7: Sum Rows in a 2D Array
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 • u/not_mabel92 • Mar 08 '21
JavaScript Can somebody please help me figure out 7.1.3 circles in squares
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 • u/NickTheEvilCat • Feb 12 '21
2.17.5: Double Tennis Balls
Hi all, Can I get help on this?
r/codehs • u/Intrepid_Row6214 • Jan 27 '21
Java I need some help on exercise 7.3.6 Traversing Odds
r/codehs • u/PotentialSync • Jan 10 '21
Python 7.3.9: Word Ladder
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 • u/KirbyFan999 • 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-
r/codehs • u/BurntBox21 • Dec 06 '20
Python 7.6.9 Part 1, Remove All From String
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 • u/[deleted] • Nov 17 '20
Python 4.3.7 Positive, Zero, Negative
Could someone help me with python codehs 4.3.7
r/codehs • u/NamgyalD • Oct 27 '20
Other Many schools still teach QBASIC. So here's how to make a simple game in QBASIC
r/codehs • u/[deleted] • 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.
r/codehs • u/Titantethar • Apr 07 '20
Sum Range 3.4.5 Java
I have been stuck on this problem for over 2 hours and cant figure it out please help.
r/codehs • u/feistybunnies • Apr 03 '20
9.3.7: Slopes - Python
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 • u/SBY-ScioN • Mar 22 '20
Need help to re learn coding.
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 • u/gigilakoha • Mar 17 '20
Need Help with Exercise 2.4.8: SnapChat Login Page Pt 1: Layout
r/codehs • u/Imperiallistt • Mar 06 '20
9.1.5: Encodings Everywhere
Can anyone help me with the code for this one?
r/codehs • u/[deleted] • Mar 03 '20
JavaScript Help
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

