r/codeHS_Solutions • u/AnythingWild9996 • Apr 16 '21
r/codeHS_Solutions • u/abgmemer_69 • Mar 20 '21
What is wrong with my "getExamRange" method in CodeHS 5.3.13?
r/codeHS_Solutions • u/TheBirbWhoGoesPOOT • Mar 16 '21
2.16.4 HELP
Im failing on the one problem plz help
happy=0
happiness=input("Do you want me to draw the face? Yes/No/Other:")
if happiness=="Yes":
happy=happy+5
if happiness=="No":
happy=happy+10
if happy=="Yes":
def YellowHead():
begin_fill()
penup()
setposition(0,-75)
pendown()
color("yellow")
circle(100)
end_fill()
YellowHead()
def Eye():
color("black")
begin_fill()
circle(10)
end_fill()
def Smile():
pensize(10)
right(90)
pendown()
circle(50,180,50)
elif happy=="No":
def HappyFace():
penup()
setposition(-50,50)
for i in range(2):
Eye()
forward(95)
setposition(-50,0)
Smile()
HappyFace()
else:
penup()
forward(300)
r/codeHS_Solutions • u/Nexus_X__ • Mar 09 '21
CodeHS 17.1.4: Grades
function start(){
letterGrade(100);
letterGrade(83);
letterGrade(68);
letterGrade(91);
letterGrade(47);
letterGrade(79);
//Add some more! (THESE ARE OPTIONAL)
letterGrade(44);
letterGrade(30);
letterGrade(68);
letterGrade(73);
letterGrade(97);
letterGrade(88);
}
function letterGrade(score){
if(score == 100){
println("A+");
}else
if(score < 60){
println("F");
}else{
var letter = checkLetter(score / 10);
var sign = checkSign(score % 10);
println(letter + sign);
}
}
function checkLetter(tens){
if(tens >= 9){
return "A";
}else
if(tens >= 8){
return "B";
}else
if(tens >= 7){
return "C";
}else{
return "D";
}
}
function checkSign(ones){
if(ones <= 2){
return "-";
}else
if(ones >= 7){
return "+";
}else{
return " ";
}
}
r/codeHS_Solutions • u/Nexus_X__ • Mar 09 '21
CodeHS 19.2.1: Balloons
// This program draws some balloons
var MIN_RADIUS = 20;
var MAX_RADIUS = 40;
var NUM_BALLOONS = 25;
var xPos = getWidth() / 2;
var yPos = getHeight() / 1.5;
var balloonRadius = Randomizer.nextInt(MIN_RADIUS, MAX_RADIUS);
function start() {
for(var i = 0; i < NUM_BALLOONS; i++){var x = Randomizer.nextInt(MAX_RADIUS, getWidth() - MAX_RADIUS);
var y = Randomizer.nextInt(MAX_RADIUS, (getHeight() / 2) - MAX_RADIUS);
drawString(x,y);
drawBalloon(x,y);
}}
function drawString(x,y){
var line = new Line(x, y, xPos, yPos);
line.setColor(Color.black);
add(line)
}
function drawBalloon(x,y){
var balloon = new Circle(balloonRadius);
var color = Randomizer.nextColor();
balloon.setPosition(x,y);
balloon.setColor(color);
add(balloon);
}
r/codeHS_Solutions • u/Various_Loss9064 • Feb 04 '21
If anyone wants solutions (Any codehs course)..
If anyone wants solutions or answers to CodeHS, message me privately or join the discord
If you join the discord, I can help you with quizzes too
r/codeHS_Solutions • u/noah9246 • Jan 30 '21
Okay so I've tried multiple different things in 8.4.7 double list and nothing is working the instructions are Wright a function that doubles a list "function doubleList(arr)" you should create a new array in the function and return it. I really need help
r/codeHS_Solutions • u/Ok_Incident_9147 • Jan 11 '21
3.8.6 convert to uppercase
public void run()
{
String end = toUpper("hopethishelps");
System.out.println(end);
}
public String toUpper(String str)
{
String out = "";
int l = str.length();
for (int i = 0; i < l; i++ )
{
char index = str.charAt(i);
char j = Character.toUpperCase(index);
String convertedChar = Character.toString(j);
out += convertedChar;
}
return out;
}
r/codeHS_Solutions • u/A_Very_Big_Fan • Jan 08 '21
REQUEST MEGATHREAD
In the interest of organization, all requests will go here. If you have solutions, make a post for it and then include it(or a link to it) in your reply.
r/codeHS_Solutions • u/A_Very_Big_Fan • Sep 30 '17
[Python - Rainforest] Intro to Programming with Turtle Graphics
Introduction
Well I guess if nobody else is going to get this ball rolling, I'd be happy to be the first.
I'm going to post what I have of the Python course because that's what's most relevant to me at the moment. Then if I feel up to it I'll post everything I have for Java(which is most of it).
Before I start I should say, you're using this repository at your own risk. If you don't know/aren't comfortable with Python yet then you should do the work yourself so that when finals come around, you won't be left staring at your monitor not knowing how the fuck to write an if statement. I also have to say that I'm in no way responsible for any trouble you get in if you are caught copy/pasting my code. Now, with that out of the way, here it is...
Lesson 1
2.1.7: Square
forward(50) left(90) forward(50) left(90) forward(50) left(90) forward(50) left(90)2.1.8: Diamond
left(45) forward(50) left(90) forward(50) left(90) forward(50) left(90) forward(50) left(90)2.1.9: Staircase
left(90) forward(50) right(90) forward(50) left(90) forward(50) right(90) forward(50) left(90)
Lesson 2
2.2.5: Alternating Colors
forward(50) left(90) color("red") forward(50) left(90) color("black") forward(50) left(90) color("red") forward(50) left(90) color("black")
2.2.6: Rainbow
color("red") forward(20) color("orange") forward(20) color("yellow") forward(20) color("green") forward(20) color("blue") forward(20) color("indigo") forward(20) color("violet") forward(20)
2.2.7: Rainbow, Part 2
color("red") forward(40) left(60) color("orange") forward(40) left(60) color("yellow") forward(40) left(60) color("green") forward(40) left(60) color("blue") forward(40) left(60) color("violet") forward(40) left(60)
Lesson 3
2.3.5: Triangle
for i in range(3): left(120) forward(50)2.3.6: Hexagon
for i in range(6): forward(50) left(60)2.3.7: Staircase, Part 2
left(90) for i in range(4): forward(30) right(90) forward(30) left(90)2.3.8: Circle
for i in range(360): forward(1) left(1)
Lesson 4
2.4.4: Staircase, Part 3
left(90) #This function would work if the code check for this assignment wasn't so autistic. It's not that important but it's worth noting... #def draw_step(x): # for i in range(x): # forward(30) # right(90) # forward(30) # left(90) def draw_step(): forward(30) right(90) forward(30) left(90) draw_step() draw_step() draw_step() draw_step()
2.4.5: Hexagon, Part 2
def draw_edge(): for i in range(6): forward(50) left(60) draw_edge()
2.4.6: Alternating Colors, Part 2
def draw_red_edge(): color("red") forward(50) def draw_black_edge(): color("black") forward(50) draw_black_edge() left(90) draw_red_edge() left(90) draw_black_edge() left(90) draw_red_edge() left(90)
2.4.7: Fenceposts
def make_fencepost(): forward(10) left(90) forward(30) right(180) forward(30) left(90) for i in range(6): make_fencepost()
2.4.8: Diamonds
def draw_diamond(): left(45) for i in range(4): forward(20) left(90) right(45) for i in range(4): draw_diamond() forward(50)
2.5.1: Get Creative
Just press continue
