|
So, I'm not necessarily new to JavaScript, but I was given an assignment that I just cannot figure out. Basically it's the age old dice roll game that we were all given, I'm sure. The teacher asked us to generate random dice rolls, display each roll into a separate alert box and then display each roll onto the document. This all sounds simple so far, I know, but the part that I just can't figure out is that he wants us to display each roll separated by a comma and stick "and" between the second to last and last numbers. (example: 4, 6, 3, 6, and 4) Which stills sounds simple until he tells us we can't use arrays to complete the task! I have to be honest with the fact that I don't know how to do this with out arrays! I'm too used to using them at this point in my life. Really we're limited to loops and if statements. If anybody has any insight on how I can go about doing this I'd appreciate it. I can post my code if that would help and I'm not even asking for a direct answer, I just don't know how to go about completing the task, just pointing me in the right direction would make me grateful. edit: posted code, anyway code:
Citanu541 fucked around with this message at 06:12 on Feb 8, 2009 |
# ¿ Feb 8, 2009 06:07 |
|
|
# ¿ May 4, 2024 16:11 |