on Sun 15 Jan 2017, 09:13 by Hitsu
Ok so,
Version #1 or version #2? Which is better?
I don't think I can evaluate which is better correctly, because the purposes are all the same. You started on the basic informations, like the name, gender, type, age, and all infos about your pet. You do activities with your pet, and all of it remains the same. And I think, if only you build on a HTML5 mini-game, it'll be much and much more simple rather than having a buncha prompts, confirms, arrays, and any basic configurations. But ah well, nevermind.
Honestly, I do think that Version #2 is better. A lot more simpler I think, w/o annoying prompts and anything like that.
Oh and, there's a little bit error w/ the version #1.
In this bit:
I do type "Female" and it'd still returns "Invalid gender."
And, even if the gender of the pet was invalid, you'd still input the wrong gender inside of the object.
Also
Put an if condition here. You don't want someone to type "999" and the program inputs it inside the data right? That, might be fatal.
Version #1 or version #2? Which is better?
I don't think I can evaluate which is better correctly, because the purposes are all the same. You started on the basic informations, like the name, gender, type, age, and all infos about your pet. You do activities with your pet, and all of it remains the same. And I think, if only you build on a HTML5 mini-game, it'll be much and much more simple rather than having a buncha prompts, confirms, arrays, and any basic configurations. But ah well, nevermind.
Honestly, I do think that Version #2 is better. A lot more simpler I think, w/o annoying prompts and anything like that.
Oh and, there's a little bit error w/ the version #1.
In this bit:
- Code:
[panda=js]if(prom3.toLowerCase() != "male" || prom3.toLowerCase() != "female") alert("Invalid gender.");
pet.gender = prom3;
I do type "Female" and it'd still returns "Invalid gender."
And, even if the gender of the pet was invalid, you'd still input the wrong gender inside of the object.
Also
- Code:
[panda=js]var prom4 = prompt("Enter your pet's age!");
pet.age = prom4;
Put an if condition here. You don't want someone to type "999" and the program inputs it inside the data right? That, might be fatal.