I love coding!! Although.. I do suck a little ;w;
I'm pretty good at HTML but everything else is terrible >w<
I'm pretty good at HTML but everything else is terrible >w<
i am a boyhello! it's nice to meet you c:
my name is calliope., but feel free to call me jake ;u;
my CS username is hipster shibe, and my DA is xalexxi! feel free to chat me up on there as well ^u^
to-do list wrote:~ collect all wishlist pets
~ get new computer... :c
~ work on commissions
cjr09 wrote:SilverPack wrote:So I started using Coding academy and I'm learning Java script. well I have to make a game for my lesson and while it says I passed I don't like how It shows both answers for the yes response. Can you guys take a look and tell me what im doing wrong its an if/else statement.
confirm("Are you ready to play?");
age = prompt("whats your age?");
if (age < 13)
{
console.log("You are allowed to play but it is discouraged.");
}
else
{
console.log("Get ready to play! You'll do great!");
}
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");
console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'");
var userAnswer = prompt("Do you want to race Bieber on stage?");
if
(userAnswer === "yes")
{
console.log("You and Bieber start racing. It's neck and neck! You win by a shoelace!");
}
else
(userAnswer === "no");
{
console.log("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");
}
var feedback = prompt("How much did you like this game? 1-10");
if
(feedback >= 8)
{
console.log("Thank you! We should race at the next concert!");
}
else
(feedback <=7)
{
console.log("I'll keep practicing coding and racing.");
}
**DISCLAMER I do not like Justin Beiber. I had to use this scenario thing for the game.... When I'm done I'm going to edit the strings so that they say a more likeable celebrity.
I'm going to point out that I know Java, but not Javascript, so this might be a little off.
You don't actually need if/else statements here, and using a bunch of if statements should actually make your program run smoother.
Else statements- at least in Java- don't need things after them. As in-
else
(feedback <=7)
{
console.log("I'll keep practicing coding and racing.");
}
Doesn't need (feedback <= 7) because else covers everything that wasn't in the previous if statement. So you really just need-
else
{
console.log("I'll keep practicing coding and racing.");
}
- But the other way to make an effective statement like this- at least in Java, still don't know Javascript, I'll look that up after school for you and make sure I'm giving you good information- is to just turn them all into if statements- aside from your very first if statement for determining age.
if(feedback <=7)
{
console.log("I'll keep practicing coding and racing.");
}
Hope this helped a bit!
Commissions wrote: Currently closed till farther notice
I love you, Avril L. wrote:I like your smile
I like your vibe
I like your style
But that's not why I love you
Lailic wrote:Pronounced: Lay-Lick
Mood: Happy (:
Preferred Pronoun: She/Her
Status: Inlove with someone just not with them
Commissions wrote: Currently closed till farther notice
I love you, Avril L. wrote:I like your smile
I like your vibe
I like your style
But that's not why I love you
Lailic wrote:Pronounced: Lay-Lick
Mood: Happy (:
Preferred Pronoun: She/Her
Status: Inlove with someone just not with them
Halloween3110 wrote:Um sorry to sound stoopid but what is coding?
here arw bbcode examples!
[quote][/quote][u][/u]
me wrote: there a few more well known coding languages like: BBCode, html, python, java, CSS, C++
Return to Fans, Clubs, and Armies
Users browsing this forum: No registered users and 22 guests