1

I made a little binary game

Rawstrus's Avatar Rawstrus9/24/16 9:21 pm
9/26/2016 5:21 pm
Rawstrus's Avatar Rawstrus
I made a small little binary game. I only spent an hour or so on it so it isn't perfect, comment any bugs you find and be sure to give feedback!

https://rawstr.us/binary
Posted by Rawstrus's Avatar
Rawstrus
Level 40 : Master Nerd
28

Create an account or sign in to comment.

10

1
09/26/2016 5:21 pm
Level 40 : Master Nerd
Rawstrus
Rawstrus's Avatar
McHorse
I think you need to work on your code.


Also, I made this within an hour or so, I am yet to do code revisions.
I am going to tidy it up now and remove unnecessary lines that were there for debugging purposes originally. This was just a test of function.
1
09/25/2016 7:33 am
Level 25 : Expert Dragonborn
NewSuperMario
NewSuperMario's Avatar
craftykids
TorrumxD, im not entirely sure how to play this.

The goal is to convert decimal (base 10) numbers to binary (base 2). If you're not familiar with number systems/binary, one of these search results might be useful.

Oh I thought the OP meant he had coded a game in binary xD
1
09/25/2016 7:07 am
Level 40 : Master Nerd
Rawstrus
Rawstrus's Avatar
craftykids15 points on my first two attempts


Nice!!
1
09/24/2016 11:37 pm
Level 24 : Expert Toast
Torrum
Torrum's Avatar
craftykids15 points on my first two attempts

TorrumxD, im not entirely sure how to play this.

The goal is to convert decimal (base 10) numbers to binary (base 2). If you're not familiar with number systems/binary, one of these search results might be useful.


Thanks you
1
09/24/2016 10:11 pm
Level 52 : Grandmaster Pixel Painter
craftykids
craftykids's Avatar
15 points on my first two attempts

TorrumxD, im not entirely sure how to play this.

The goal is to convert decimal (base 10) numbers to binary (base 2). If you're not familiar with number systems/binary, one of these search results might be useful.
1
09/24/2016 9:31 pm
Level 24 : Expert Toast
Torrum
Torrum's Avatar
xD, im not entirely sure how to play this.
1
09/24/2016 9:26 pm
Level 16 : Journeyman Dragon
Latiodile
Latiodile's Avatar
clicking the numbers seems to be quite unresponsive
1
09/25/2016 7:08 am
Level 40 : Master Nerd
Rawstrus
Rawstrus's Avatar
How so?
1
09/25/2016 9:52 am
Level 71 : Legendary Unicorn
McHorse
McHorse's Avatar
Because you've got syntax error in your application:

SyntaxError: Unexpected token '*'

And you're getting syntax error in your application, because you're using ES6 operator **. There's still lot of people who use browsers without ES6 support, that why front-end developer using babel or similar to translate their code into ES5 friendly code.

Simply change:

function resetBits(){
for(i=0;i<8;i++){
$('#bin' + 2**i).removeClass("active");
$('#bin' + 2**i).attr('src', 'img/0.png');
currentSum = 0;
}
}


To:

function resetBits(){
for(i=0;i<8;i++){
$('#bin' + Math.pow(i, 2)).removeClass("active").attr('src', 'img/0.png');
}

currentSum = 0;
}


I think you need to work on your code.
1
09/26/2016 5:08 pm
Level 40 : Master Nerd
Rawstrus
Rawstrus's Avatar
ah yes I was originally working with Python, forgot to use this for js, thanks for spotting it!
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome