![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
Newbie
Join Date: Mar 2005
Posts: 9
Rep Power: 0
![]() |
Thanx for the help but it keeps on breaking on the first RPS(1) and can;'t figure out why. I already changed the array.
|
|
|
|
|
|
#12 |
|
Newbie
Join Date: Mar 2005
Posts: 9
Rep Power: 0
![]() |
Finnaly got it all working now just need a simple fix. When I run the program ir shows 0,1,2 instead of rock paper scissor. Can' you show me what can I add or what is wrong.
[PHP] Dim P1 As Integer, P2 As Integer Dim RPS(3) As Integer Dim Winner As Integer Dim x As Integer Dim rock, paper, scissors As Single lstp1.Items.Add(P1) lstp2.Items.Add(P1) lstwin.Items.Add(Winner) rock = 0 paper = 1 scissors = 2 Randomize() For x = 0 To 100 P1 = Int(3 * Rnd()) P2 = Int(3 * Rnd()) Select Case P1 Case rock Select Case P2 Case rock Winner = 1 Case paper Winner = 3 Case scissors Winner = 2 End Select Case paper Select Case P2 Case rock Winner = 2 Case paper Winner = 1 Case scissors Winner = 3 End Select Case scissors Select Case P2 Case rock Winner = 3 Case paper Winner = 2 Case scissors Winner = 1 End Select End Select lstp1.Items.Add(P1) lstp2.Items.Add(P2) lstwin.Items.Add("Player " & Winner) Next End Sub[/PHP] |
|
|
|
|
|
#13 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
You need that array. It should work as I've typed it, if you haven't set the Option Base to 1.
|
|
|
|
|
|
#14 |
|
Newbie
Join Date: Mar 2005
Posts: 9
Rep Power: 0
![]() |
Whenever I add this part it just crashes the program.
[PHP]Enum RPS Rock = 0, Paper, Scissors End Enum RPS(0) = "Rock" RPS(1) = "Paper" RPS(2) = "Scissors"[/PHP] Last edited by Batalia2; Mar 21st, 2005 at 4:05 PM. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|