A WILD BUG APPEARED! - WHALESHARES UP FOR GRABS!!

in #contest7 years ago (edited)

wild_bug.png

EDIT: As contestants seem to get confused with the question, I will change it to be clearer. NEW QUESTION: A BUG CAUSES THE FUNCTION TO FAIL. SPOT THE BUG/S AND PROVIDE THE EXPECTED OUTPUT AFTER THE BUG IS FIXED. With this changes I am allowing @walnut1 , @seyiodus and @codingdefined to edit their comments once. :)

DAY 1

If you don't know what this is then click here.

How to Join?

  1. Upvote this post.
  2. Satisfy the requirements being asked for and comment it down below (either list the bugs found or provide the correct block of code).
  3. Only one entry per account, Once you post it you can no longer edit it.
  4. Don't forget the random quote w/ author!

What do you get?

For this particular day you can get 10 Whaleshares courtesy of @akrid for the first TWO who get the correct answer. Prizes vary per contest so watch out.

Happy Hunting and Good Luck!

Question: A bug causes the function to fail, spot the bug and provide the expected output.

NEW QUESTION: A BUG CAUSES THE FUNCTION TO FAIL. SPOT THE BUG/S AND PROVIDE THE EXPECTED OUTPUT AFTER THE BUG IS FIXED.

-- start -- 
function bug_hunting () {
   for (var x=1; x <=5 ; x+=) 
      if (x === 0) { console.log(x +  " is zero"); }
      elseif (x % 2 === 0) { consle.log(x + " even");   
      else { console.log(x + " is odd"); }
   }
}
bug_hunting();
-- end --

Contestants must also have or be willing to make a bitshares account to claim prizes, if you don't have one yet you can make on here

Come join us on Whaleshares Discord: https://discordapp.com/invite/qDUmmPC . Come chat with me!! :D

That's it for now, see you guys in the next one, keep your eyes open and Gotta Catch 'Em All!!!


jep_banner.png


Follow @contests for all kinds of Whaleshares contests!

A HUGE THANK YOU to @officialfuzzy, @blocktrades and @akrid for making this contest possible. If you don't know what Whaleshares are or want to learn more about Whaleshares click this.

Sort:  
Loading...
Loading...
Loading...

These are the bugs.

"elseif"  

instead of "else if"

"{ consle.log(x + " even");"  

There is no curly base at the end.

"else"  

There is no 'if' there.

expected output.

for (var x=1; x <=5 ; x+=) 
  if (x === 0) { console.log(x +  " is zero"); }
  else if (x % 2 === 0) { consle.log(x + " even"); }  
  else if { console.log(x + " is odd"); }
}

"People are mostly focused on defending the computers on the Internet, and there's been surprisingly little attention to defending the Internet itself as a communications medium." - W. Daniel Hillis

hello @seyiodus, I did a edit with the question as I understand that it seems a little confusing. You can edit your answer once. Good Luck!

Loading...

thanks :) you should join in!

This post has received a 9.39 % upvote from @buildawhale thanks to: @jepu. Send at least 1 SBD to @buildawhale with a post link in the memo field for a portion of the next vote.

To support our daily curation initiative, please vote on my owner, @themarkymark, as a Steem Witness

You got a 5.15% upvote from @upme requested by: @jepu.
Send at least 1 SBD to @upme with a post link in the memo field to receive upvote next round.
To support our activity, please vote for my master @suggeelson, as a STEEM Witness

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.029
BTC 76024.68
ETH 2926.23
USDT 1.00
SBD 2.60