|
| 25 Oct 2014 04:49 PM |
making this cuz bored
idk what semiclon i has to add qqqqqqqqqqqqq pastebin /DFUHfMqF |
|
|
| Report Abuse |
|
|
| |
|
WebGL3D
|
  |
| Joined: 04 Sep 2013 |
| Total Posts: 28311 |
|
|
| 25 Oct 2014 06:27 PM |
You're doing it wrong
RIGHT: if(x){ }else if(y){ }else if(z){ }else{ }
WRONG: if{(x) }else if{(y) }else if{(z) }else{ }
~ 1Topcop ~ WebGL3D ~ Java3D ~ Data3D ~ Purple Squid > |
|
|
| Report Abuse |
|
|
|
| 25 Oct 2014 06:28 PM |
| i did it like that before tho and it didnt work :( |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 26 Oct 2014 08:32 AM |
web i made it like it was b4
now i think something is wrong witht the math random |
|
|
| Report Abuse |
|
|
WebGL3D
|
  |
| Joined: 04 Sep 2013 |
| Total Posts: 28311 |
|
|
| 26 Oct 2014 08:41 AM |
oh lol didn't even realize
that's not how you use Math.random, Math.random is intended to be used with numbers. Try something like:
x = {"r":"rock","p":"paper","s":"scissors"} answer = prompt("Choose r, p, or s"); choice = x[answer]; if(choice==x.r){ console.log("Chose rock!"); }
~ 1Topcop ~ WebGL3D ~ Java3D ~ Data3D ~ Purple Squid > |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2014 08:48 AM |
could i assign double values to r s and p
like r = rock, 1 without arrays
also send trades |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2014 08:50 AM |
dang it web y u beat me 2 da punch |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2014 08:58 AM |
what exactly did web make
a dictionary?
cuz idk what dictionary is and how to make 1
also send trades |
|
|
| Report Abuse |
|
|
WebGL3D
|
  |
| Joined: 04 Sep 2013 |
| Total Posts: 28311 |
|
|
| 26 Oct 2014 08:59 AM |
It's called a dictionary in Lua, in JavaScript it's an Object, similar to a JavaScript array, only arrays don't have predefined indexes.
~ 1Topcop ~ WebGL3D ~ Java3D ~ Data3D ~ Purple Squid > |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2014 09:00 AM |
could u say that simpler
and examples of both
pls
also send trades |
|
|
| Report Abuse |
|
|
WebGL3D
|
  |
| Joined: 04 Sep 2013 |
| Total Posts: 28311 |
|
|
| 26 Oct 2014 09:06 AM |
arr = ["This","is","an","array"]; // Arrays allow you to store multiple elements under one place
obj = {"Hello":"world"}; /* Like arrays, objects allow you to store multiple elements under one place. The difference is objects you set the indexes (in this case "Hello" is an index), and the indexes point to the values */
console.log(arr[0]); // > This /* Array indexes are always numbers, the number will be -1 the place in the array you're trying to get. So if you're trying to get the third value, use 2 */
console.log(obj['Hello']); // > world /* To get a value from an Object, use the index you've set. There are two ways to do this, object['index'] or object.index If your index begins with a number, or has special characters (excluding the underscore _) use the first method. */
~ 1Topcop ~ WebGL3D ~ Java3D ~ Data3D ~ Purple Squid > |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2014 09:14 AM |
whats an index also send trades |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2014 09:16 AM |
wow what a noob
i maded a tompatoe 5 u |
|
|
| Report Abuse |
|
|
WebGL3D
|
  |
| Joined: 04 Sep 2013 |
| Total Posts: 28311 |
|
|
| 26 Oct 2014 09:17 AM |
An index is exactly what it sounds like it's like looking in the table contents for example, you look in and see "x is on page y" x being the index of page y Kind of how a JavaScript object works, it looks in z for the index of x, and finds the value (y)
~ 1Topcop ~ WebGL3D ~ Java3D ~ Data3D ~ Purple Squid > |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2014 09:31 AM |
i updated
y no work
just goes straight to the else
also send trades |
|
|
| Report Abuse |
|
|
| |
|
| |
|