# Are these well written algorithms?

• 01-12-2012, 05:50 AM
dharav
Are these well written algorithms?
I have to write algorithms for my grade11 java class and i just wanted to know if these are good algorithms?

1. Declare all variables needed.
2. Declare all the arrays .
3. Initialize arrays as needed.
4. Initialize variables as needed.
5. Prompt user for their name.
6. Declare a if statement with 2 city outputs.
7. Initialize array.
8. For city chosen add the Sp and Hp to array.
9. Calculate random number.
10. Declare a if statement if the number even continue if odd press enter.
11. Declare a for loop (villain greater than or = to 5) and go into loop if less than 5.
12. Initialize a array with 1hp and 1 sp.
13. Prompt user to press enter to hit.
14. Subtract sp of players array by villains hp array.
15. Prompt User with win screen.
16. Add Sp chosen and add hp chosen at beginning of game.
17. If more than 5 continue.
18. Calculate random Number between 1-10.
19. Initialize variable If number is 1 or 10 continue if not go in to loop and redo step ``18``.
20. If 1 0r 10 Continue.
21. Prompt User with screen to show the villain.
22. Initialize a array with 24 hp and 6sp.
23. Prompt to press enter to hit.
24. Minus players sp from array by villains hp.
25. Minus villains sp from array by players hp.
26. If villain array value of hp is 0 or less continue or else if 1or more in hp repeat step ``23``.
27. Prompt User with winning screen to Praise them.
:(nerd):
• 01-12-2012, 05:53 AM