Author |
Message |
arch_enemy
Level 7
Posts: 797 |
Joined: Fri Mar 06, 2015 1:25 am |
Cash on hand: 615.29
Bank: 0.00
Location: louisiana |
Group: Registered users |
Country: |
|
random code learning progress
yep imma try to learn how to code and i made this thread to document my progress which will probably be little to none anyways... first bit of progress using javascript is a html based dice roller which so far i haven't figured out how to allow changing the number of dice and what number of side they have but that'll have to wait for now anyways heres the roller https://www.dropbox.com/s/ryj9jislrpukl ... .html?dl=0*EDIT* Version 1.02 is now live changelog: added button
_________________ I WANT TO WATCH THE FUCKING WORLD BURN!!!!!!!!!!
|
Tue Dec 20, 2016 5:44 am |
|
|
Pantsman
Level 39
Posts: 21063 |
Joined: Sat Feb 14, 2009 11:44 pm |
Cash on hand: 2,187.55
Bank: 5,250.50
Group: Sysop |
|
Re: random code learning progress
Add a +1 to emulate true 6-sided dies. because there's no 'output zero' on 6-sided die.
_________________
Yeap.
_________________
1 pcs.
|
4 pcs.
|
|
Tue Dec 20, 2016 8:07 am |
|
|
Parpol
Level 38
Posts: 10364 |
Joined: Sun Oct 26, 2008 5:47 am |
Cash on hand: 435.45
Bank: 2,750,364.30
Group: Dev Team |
|
Re: random code learning progress
yeah, instead of *7, change it to *6 + 1, and it will go between 1 and 6.
the reason it's *6 and not *5 is because random goes between 0 and 0.9999999999.... so random * 6 can never be 6. so random * 6 is betwee 0 and 5.9999, (converting it to integers, it's between 0 and 5), and adding + 1 will make it go between 1 and 6
_________________ My Pixiv
- Spoiler: show
- OLD VERSION, BITCHES!
|
Tue Dec 20, 2016 10:40 pm |
|
|
arch_enemy
Level 7
Posts: 797 |
Joined: Fri Mar 06, 2015 1:25 am |
Cash on hand: 615.29
Bank: 0.00
Location: louisiana |
Group: Registered users |
Country: |
|
Re: random code learning progress
i adjusted it accordingly
_________________ I WANT TO WATCH THE FUCKING WORLD BURN!!!!!!!!!!
|
Tue Dec 20, 2016 11:42 pm |
|
|
arch_enemy
Level 7
Posts: 797 |
Joined: Fri Mar 06, 2015 1:25 am |
Cash on hand: 615.29
Bank: 0.00
Location: louisiana |
Group: Registered users |
Country: |
|
Re: random code learning progress
new version uploaded
_________________ I WANT TO WATCH THE FUCKING WORLD BURN!!!!!!!!!!
|
Sat Dec 24, 2016 10:05 am |
|
|
Pantsman
Level 39
Posts: 21063 |
Joined: Sat Feb 14, 2009 11:44 pm |
Cash on hand: 2,187.55
Bank: 5,250.50
Group: Sysop |
|
Re: random code learning progress
BUTAN GET.
_________________
Yeap.
_________________
1 pcs.
|
4 pcs.
|
|
Sat Dec 24, 2016 3:23 pm |
|
|
|