r/codehs • u/sarokin • Mar 18 '23
r/codehs • u/Individual_Rest_197 • Jan 13 '23
JavaScript I do not understand why my rollCount won't increase
r/codehs • u/Remarkable-Chip5248 • Jan 07 '23
Can anybody please tell me what I am missing
r/codehs • u/unknown_person12830 • Dec 06 '22
Does everyone got any ideas what I'm doing wrong?
r/codehs • u/EochiMochi • Nov 30 '22
does anybody know how to do Target Karel CodeHS on Extra Karel Puzzles? this is on python but i can work with javascript code as well.
r/codehs • u/TectonicToaster • Nov 28 '22
JavaScript This codeHS JavaScript sandbox program for JavaScript Graphics
I made this but it sucks, jumping on the second platform is buggy and the jumping is also buggy and when you are jumping you are not actually touching the ground can someone help me fix these I made some workarounds to my problems but I think they can just be fixed in the first place.
r/codehs • u/Ultragaming62 • May 06 '22
JavaScript 4.2.5 Growing Circle
I need some help stopping this timer when the circle is as tall as the canvas. I've tried everything i can think of, but nothing is working. Here's the requirements:
You should write a program that draws a circle of size START_RADIUS in the middle of the screen and then animates the circle growing by INCREMENT every 50 milliseconds.
You should use circle.setRadius() and circle.getRadius().
When the circle covers the whole height, you should stop the timer.
Every time the circle grows by CHANGE_COLORS_AT, you should change to color to a random color. (Hint: you’ll need to use the mod operator %)
Getting and Setting the Radius
getRadius() can be used to find the radius of a circle. It returns an integer. For example, if the program has a blue circle named blueCircle with a radius of 15, blueCircle.getRadius() will return 15. This value can be store in a variable.
The radius of a circle can be updated in a similar manner using setRadius. Using the blueCircle example from above, the radius could be set to 30 with blueCircle.setRadius(30).
here's my code so far:
var START_RADIUS = 1;
var INCREMENT = 1;
var CHANGE_COLORS_AT = 10;
var MAX_RADIUS = getHeight();
var num = 0;
function start(){
setTimer(newCircle, 50);
}
function newCircle(){
var color = Randomizer.nextColor();
var circle = new Circle(START_RADIUS);
circle.setColor(color);
circle.setPosition(getWidth()/2, getHeight()/2);
add(circle);
num = num+1;
if(num%10==0){
circle.setRadius(num/10+INCREMENT);
}
if(circle.getRadius()==(getHeight())){
stopTimer(getHeight());
}
}
Any ideas?
r/codehs • u/[deleted] • Mar 09 '22
Can someone please help with 12.3.6 The Rectangle Class, Part 5
r/codehs • u/Peen_Diep • Dec 21 '21
Please help I've been stuck staring at my screen for hours. 5.4.8 AP Comp Sci A Nitro
r/codehs • u/Background_Sea7067 • Jun 10 '21
I need help with exercise 25.13.4 building a database for codehs in JavaScript
r/codehs • u/dkshuks • Jun 02 '21
3.3.4: Families SQL
Need help urgent, please. Ive tried too many times and its not working help. SQL Functions
r/codehs • u/BepoFlepo • May 19 '21
THIS IS SO ANNOYING
So my code works and counts the head streaks EXCEPT for when it reaches "Longest streak of heads: 3" instead my code prints out "Longest streak of heads: 6" HELP ME please help me HELP
var NUM_FLIPS = 40;
var Heads = "Heads";
var Tails = "Tails";
function start(){
var flips = flipCoins();
printArray(flips);
longestHeadsStreak(flips);}
// This function should flip a coin NUM_FLIPS
// times, and add the result to an array. We
// return the result to the caller.
function flipCoins(){
var flips = \[\];
for(var i = 0; i < NUM_FLIPS; i++){
if(Randomizer.nextBoolean()){
flips.push("Heads");
}else{
flips.push("Tails");
}
}
return flips;}
function printArray(arr){
for(var i = 0; i < arr.length; i++){
println(i + ": " + arr\[i\]);
}}
function longestHeadsStreak(flips){
var countHeads = 0;
var countTails = 0;
for(var i = 0; i < flips.length; i++){
if(flips[i]=="Heads"){
countHeads+=1;
}else{
countTails+=1;
}
}
println("Longest Streak of Heads: " + countHeads);
}
r/codehs • u/Historical-Tax-2010 • May 09 '21
Guidelines
Are we not following the only rule now or are there just no mods to enforce people blatantly asking for answers? I feel like it's become common to just see people asking for a solution without showing that they've at least made an effort...
r/codehs • u/Sun_mar7 • May 05 '21
Is the Princeton review AP CSA book good? any opinions on this book?
Is the Princeton review AP CSA book good?
I've been doing some of the FRQs on this book but they've been quite difficult and very long compared to the past papers. If anyone's used the Princeton review book to study for the AP CSA exam, what are your opinions on it?
Do you think I should continue working on it? or are there anything else that I should be checking for last-minute prep?
ps. I have the exam tomorrow so if you could reply asap that would be great!
r/codehs • u/gigapudding43201 • Apr 07 '21
4.4.5 Help
years=input("Age:")
citizen= input("Born in the U.S.? (Yes/No):")
residency= input("Years of Residency:")
if years >= str(35) and citizen == "yes" and residency >= str(14):
print("You are eligible to run for president!")
else:
print("You are not eligible to run for president. ")
Getting an error. The program says that my code is not displaying "You are not eligible to run for president" when it does. Help?


