Multi
Multi
  • Pages:
  • 1
My 2nd ever code
Topic Started: Tuesday, 5. October 2010, 18:23 (964 Views)
Sith
No Avatar
Fblthp
1st one didn't have a purpose, but this one could be useful: http://z3.ifrm.com/53/36/0/p366853/code2.html

xDDDDDDDDDDDDDDD

:geek:
Posted Image

Last.fm
Off
Profile
Quote
Top
 
Chesterfield
Member Avatar
Level 12
Lol nice.
Should put like an auto refresh or something after you close the dialog box with the answer :P .
Off
Profile
Quote
Top
 
Madyy
Member Avatar
Level 14
Ahaha nice. xD
Off
Profile
Quote
Top
 
FallenShadow
No Avatar
The Stoner Artist
Wow Sith xD

www.FallnShadw.com
Personal and Professional Portfolio. Officially Open.
Off
Profile
Quote
Top
 
Reid
Member Avatar
Es una trampa!
Fancy; moving on up. :P

Just so you know, you don't have to store the prompts as variables:
Code:
 
alert("So I heard you wanted to multiply two numbers together?");
alert("Result: " + (prompt("Enter number one: ", 0) * prompt("Enter number two: ", 0)));
Reid
Off
Profile
Quote
Top
 
Joe
Member Avatar
Hi.
I prefer console.log() versus alert(), but still, nice job Sith. :clown:
Joe
Off
Profile
Quote
Top
 
KyleFA
Member Avatar
Mary Jane ..merp
xD FAIL!! :P I didnt get the right answer..xD
Posted Image
Gold Coins and Pat on the Backs
Off
Profile
Quote
Top
 
Sith
No Avatar
Fblthp
What did you put? o.0
Posted Image

Last.fm
Off
Profile
Quote
Top
 
Gabe.
Member Avatar

lol i got the right answer nice job
Posted Image

Ask your favourite gold member a question :r
old siggehs



Off
Profile
Quote
Top
 
Joe
Member Avatar
Hi.
Sith
Wednesday, 6. October 2010, 19:09
What did you put? o.0
Me?

console.log() simply logs whatever you'd like in a little box.. no annoying alerts. CTRL + Shift + I in Chrome, and then click the console tab.
Joe
Off
Profile
Quote
Top
 
Reid
Member Avatar
Es una trampa!
Sith
Wednesday, 6. October 2010, 19:09
What did you put? o.0
Javascript uses a floating-point number system, which can be inaccurate. For example, 0.1 * 0.2 is inaccurate (it gives 0.020000000000000004). This is because all numbers are in binary in JS (it's a speed increase), and there are certain numbers that can't be accurately written in binary (just as 2/3 can only be approximated to 0.6666667 in decimal). Fractions in particular are prone to these errors.
Reid
Off
Profile
Quote
Top
 
Kiwi
No Avatar
Level 9
Ehh, Offtopic... But Di** times Di** = NaN
Posted Image
Off
Profile
Quote
Top
 
Andrew
Member Avatar
ぼくたちがすべてはばか。
NaN stands for Not A Number.
Posted Image

Professional web design/development services.http://wildandrewlee.com/
Off
Profile
Quote
Top
 
Zema
Member Avatar
Lore Master
Not gonna lie... I giggled.
Posted Image
Posted Image
Forum | Register | World | Guidebook | Services | Advertise
Off
Profile
Quote
Top
 
Kiwi
No Avatar
Level 9
Pro
Thursday, 7. October 2010, 00:37
NaN stands for Not A Number.
don't ruin my fun plox.
Posted Image
Off
Profile
Quote
Top
 
Drama
Member Avatar
Level 11
Nice code. :P
Off
Profile
Quote
Top
 
ærodynamik.
No Avatar
Level 6
Awesome, lmao. XD
Off
Profile
Quote
Top
 
Kelly
Member Avatar
Level 5
Lmfao it's awesome. Please, put a Roll-Roll Code next time. =3
I love this code as well as those codes that are indeed funny [roll-roll: you click on a link, and the picture of Elvis Presley or Anyone appears and it never stopps rolling LMAO]
Avatar Artist II IconFX.comI LOVE NOCTIS<33
Off
Profile
Quote
Top
 
BetaRick
Member Avatar
Level 4
lol. I hate writing javascript, but some of its functions (such as the topic of this thread) are useful, nice job. Although some people have pointed out other ways of accomplishing this (not including multiplying decimals) shortcuts don't have to be taken. Nice job! XD
Off
Profile
Quote
Top
 
Nick
Member Avatar
Let it go, let it go, can't hold it back anymore!
Awesome job Sith :D
Ephex - A Development, Design & Community Discord

Posted Image

Nick | 'Atta Boy Luther! | Outline Manager | Ask Me!

Myy Stuff
Off
Profile
Quote
Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Theme & Layout Display · Next Topic »
  • Pages:
  • 1

Welcome Guest [Log In] [Register]
Outline Live
Loading..
Loading..