Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GraphicsWindow.Show() 'Show graphics window
- GraphicsWindow.Title = "The Student Log" 'Sets title of graphics window
- GraphicsWindow.Height = 1080 'Sets height of graphics window
- GraphicsWindow.Width = 1920 'Sets width of graphics window
- GraphicsWindow.BackgroundColor = "Black" 'Sets background colour to black
- GraphicsWindow.BrushColor = "Yellow"
- GraphicsWindow.FontSize=25 'Sets font size
- GraphicsWindow.DrawText(50, 10, "CSGOLD") 'Draws title on graphics window
- GraphicsWindow.BrushColor = "Yellow" 'Sets brush colour to
- GraphicsWindow.FillRectangle(0, 100, 100, 800)
- rotateshape = "C:\Users\Charlie\Pictures\Saved Pictures\PC Jokes\wheel.png"
- image=Shapes.AddImage(rotateshape)
- Shapes.Move(image, 200, 100)
- GraphicsWindow.BrushColor = "Green"
- GraphicsWindow.DrawTriangle(400, 100, 390, 90, 410, 90)
- GraphicsWindow.FillTriangle(400, 100, 390, 90, 410, 90)
- user[1] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username1.txt")
- user[2] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username2.txt")
- user[3] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username3.txt")
- user[4] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username4.txt")
- user[5] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username5.txt")
- user[6] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username6.txt")
- user[7] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username7.txt")
- user[8] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\username8.txt")
- password[1] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password1.txt")
- password[2] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password2.txt")
- password[3] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password3.txt")
- password[4] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password4.txt")
- password[5] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password5.txt")
- password[6] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password6.txt")
- password[7] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password7.txt")
- password[8] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\password8.txt")
- balance[1] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance1.txt")
- balance[2] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance2.txt")
- balance[3] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance3.txt")
- balance[4] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance4.txt")
- balance[5] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance5.txt")
- balance[6] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance6.txt")
- balance[7] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance7.txt")
- balance[8] = File.ReadContents("C:\Users\Charlie\Desktop\Programming\csgold\balance8.txt")
- bet[1] = 0
- bet[2] = 0
- bet[3] = 0
- bet[4] = 0
- bet[5] = 0
- bet[6] = 0
- bet[7] = 0
- bet[8] = 0
- bettype[1] = "Nothing"
- bettype[2] = "Nothing"
- bettype[3] = "Nothing"
- bettype[4] = "Nothing"
- bettype[5] = "Nothing"
- bettype[6] = "Nothing"
- bettype[7] = "Nothing"
- bettype[8] = "Nothing"
- GraphicsWindow.FontSize=15
- GraphicsWindow.BrushColor = "black"
- GraphicsWindow.FillRectangle(800, 300, 300, 470)
- GraphicsWindow.BrushColor="#ffd400"
- GraphicsWindow.DrawBoundText(800, 300, 400, user[1] + " : " + bet[1] + " on " + bettype[1] + " " +" Remaining Balance: " + balance[1])
- GraphicsWindow.DrawBoundText(800, 360, 400, user[2] + " : " + bet[2] + " on " + bettype[2] + " " +" Remaining Balance: " + balance[2])
- GraphicsWindow.DrawBoundText(800, 420, 400, user[3] + " : " + bet[3] + " on " + bettype[3] + " " +" Remaining Balance: " + balance[3])
- GraphicsWindow.DrawBoundText(800, 480, 400, user[4] + " : " + bet[4] + " on " + bettype[4] + " " +" Remaining Balance: " + balance[4])
- GraphicsWindow.DrawBoundText(800, 540, 400, user[5] + " : " + bet[5] + " on " + bettype[5] + " " +" Remaining Balance: " + balance[5])
- GraphicsWindow.DrawBoundText(800, 600, 400, user[6] + " : " + bet[6] + " on " + bettype[6] + " " +" Remaining Balance: " + balance[6])
- GraphicsWindow.DrawBoundText(800, 660, 400, user[7] + " : " + bet[7] + " on " + bettype[7] + " " +" Remaining Balance: " + balance[7])
- GraphicsWindow.DrawBoundText(800, 720, 400, user[8] + " : " + bet[8] + " on " + bettype[8] + " " +" Remaining Balance: " + balance[8])
- GraphicsWindow.BrushColor = "Black"
- Controls.AddButton("Place Bet", 800, 200)
- Controls.ButtonClicked = OnButtonClicked
- Sub OnButtonClicked
- TextWindow.Show()
- TextWindow.Clear()
- TextWindow.WriteLine("Who are you?")
- For i = 1 To 8
- TextWindow.WriteLine(i + " = " + user[i])
- EndFor
- username = TextWindow.Read()
- If username < 9 And username > 0 Then
- TextWindow.WriteLine("Ok, " + user[username] + " What is your password?")
- pass = TextWindow.Read()
- If pass = password[username] Then
- TextWindow.Clear()
- TextWindow.WriteLine("Which colour would you like to place a bet on, " + user[username] + "?")
- TextWindow.WriteLine("G = Grey, B = Blue, R = Red, X = Gold")
- colourplace = TextWindow.Read()
- If colourplace = "G" Then
- TextWindow.WriteLine("Grey has been chosen.")
- TextWindow.WriteLine("Your balance is: " + balance[username])
- TextWindow.WriteLine("How much do you want to bet?")
- bet[username] = TextWindow.Read()
- If bet[username] > 0 And bet[username] < 100000000 And bet[username] < balance[username]+1 Then
- TextWindow.WriteLine("Bet Accepted")
- bettype[username] = "Grey"
- balance[username] = balance[username]-bet[username]
- TextWindow.Hide()
- GraphicsWindow.FontSize=15
- GraphicsWindow.BrushColor = "black"
- GraphicsWindow.FillRectangle(800, 300, 300, 470)
- GraphicsWindow.BrushColor="#ffd400"
- For i = 1 to 8
- GraphicsWindow.DrawBoundText(800, 240+i*60, 400, user[i] + " : " + bet[i] + " on " + bettype[i] + " " +" Remaining Balance: " + balance[i])
- EndFor
- Else
- bet[username] = 0
- TextWindow.WriteLine("Bet not accepted. Either over 100000000 or over balance or invalid.")
- TextWindow.Pause()
- TextWindow.Hide()
- EndIf
- Else
- If colourplace = "B" Then
- TextWindow.WriteLine("Blue has been chosen.")
- TextWindow.WriteLine("Your balance is: " + balance[username])
- TextWindow.WriteLine("How much do you want to bet?")
- bet[username] = TextWindow.Read()
- If bet[username] > 0 And bet[username] < 100000000 And bet[username] < balance[username]+1 Then
- TextWindow.WriteLine("Bet Accepted")
- bettype[username] = "Blue"
- balance[username] = balance[username]-bet[username]
- TextWindow.Hide()
- GraphicsWindow.FontSize=15
- GraphicsWindow.BrushColor = "black"
- GraphicsWindow.FillRectangle(800, 300, 300, 470)
- GraphicsWindow.BrushColor="#ffd400"
- GraphicsWindow.DrawBoundText(800, 300, 400, user[1] + " : " + bet[1] + " on " + bettype[1] + " " +" Remaining Balance: " + balance[1])
- GraphicsWindow.DrawBoundText(800, 360, 400, user[2] + " : " + bet[2] + " on " + bettype[2] + " " +" Remaining Balance: " + balance[2])
- GraphicsWindow.DrawBoundText(800, 420, 400, user[3] + " : " + bet[3] + " on " + bettype[3] + " " +" Remaining Balance: " + balance[3])
- GraphicsWindow.DrawBoundText(800, 480, 400, user[4] + " : " + bet[4] + " on " + bettype[4] + " " +" Remaining Balance: " + balance[4])
- GraphicsWindow.DrawBoundText(800, 540, 400, user[5] + " : " + bet[5] + " on " + bettype[5] + " " +" Remaining Balance: " + balance[5])
- GraphicsWindow.DrawBoundText(800, 600, 400, user[6] + " : " + bet[6] + " on " + bettype[6] + " " +" Remaining Balance: " + balance[6])
- GraphicsWindow.DrawBoundText(800, 660, 400, user[7] + " : " + bet[7] + " on " + bettype[7] + " " +" Remaining Balance: " + balance[7])
- GraphicsWindow.DrawBoundText(800, 720, 400, user[8] + " : " + bet[8] + " on " + bettype[8] + " " +" Remaining Balance: " + balance[8])
- Else
- bet[username] = 0
- TextWindow.WriteLine("Bet not accepted. Either over 100000000 or over balance or invalid.")
- TextWindow.Pause()
- TextWindow.Hide()
- EndIf
- Else
- If colourplace = "R" Then
- TextWindow.WriteLine("Red has been chosen.")
- TextWindow.WriteLine("Your balance is: " + balance[username])
- TextWindow.WriteLine("How much do you want to bet?")
- bet[username] = TextWindow.Read()
- If bet[username] > 0 And bet[username] < 100000000 And bet[username] < balance[username]+1 Then
- TextWindow.WriteLine("Bet Accepted")
- bettype[username] = "Red"
- balance[username] = balance[username]-bet[username]
- TextWindow.Hide()
- GraphicsWindow.FontSize=15
- GraphicsWindow.BrushColor = "black"
- GraphicsWindow.FillRectangle(800, 300, 300, 470)
- GraphicsWindow.BrushColor="#ffd400"
- GraphicsWindow.DrawBoundText(800, 300, 400, user[1] + " : " + bet[1] + " on " + bettype[1] + " " +" Remaining Balance: " + balance[1])
- GraphicsWindow.DrawBoundText(800, 360, 400, user[2] + " : " + bet[2] + " on " + bettype[2] + " " +" Remaining Balance: " + balance[2])
- GraphicsWindow.DrawBoundText(800, 420, 400, user[3] + " : " + bet[3] + " on " + bettype[3] + " " +" Remaining Balance: " + balance[3])
- GraphicsWindow.DrawBoundText(800, 480, 400, user[4] + " : " + bet[4] + " on " + bettype[4] + " " +" Remaining Balance: " + balance[4])
- GraphicsWindow.DrawBoundText(800, 540, 400, user[5] + " : " + bet[5] + " on " + bettype[5] + " " +" Remaining Balance: " + balance[5])
- GraphicsWindow.DrawBoundText(800, 600, 400, user[6] + " : " + bet[6] + " on " + bettype[6] + " " +" Remaining Balance: " + balance[6])
- GraphicsWindow.DrawBoundText(800, 660, 400, user[7] + " : " + bet[7] + " on " + bettype[7] + " " +" Remaining Balance: " + balance[7])
- GraphicsWindow.DrawBoundText(800, 720, 400, user[8] + " : " + bet[8] + " on " + bettype[8] + " " +" Remaining Balance: " + balance[8])
- Else
- bet[username] = 0
- TextWindow.WriteLine("Bet not accepted. Either over 100000000 or over balance or invalid.")
- TextWindow.Pause()
- TextWindow.Hide()
- EndIf
- Else
- If colourplace = "X" Then
- TextWindow.WriteLine("Gold has been chosen.")
- TextWindow.WriteLine("Your balance is: " + balance[username])
- TextWindow.WriteLine("How much do you want to bet?")
- bet[username] = TextWindow.Read()
- If bet[username] > 0 And bet[username] < 100000000 And bet[username] < balance[username]+1 Then
- TextWindow.WriteLine("Bet Accepted")
- bettype[username] = "Gold"
- balance[username] = balance[username]-bet[username]
- TextWindow.Hide()
- GraphicsWindow.FontSize=15
- GraphicsWindow.BrushColor = "black"
- GraphicsWindow.FillRectangle(800, 300, 300, 470)
- GraphicsWindow.BrushColor="#ffd400"
- GraphicsWindow.DrawBoundText(800, 300, 400, user[1] + " : " + bet[1] + " on " + bettype[1] + " " +" Remaining Balance: " + balance[1])
- GraphicsWindow.DrawBoundText(800, 360, 400, user[2] + " : " + bet[2] + " on " + bettype[2] + " " +" Remaining Balance: " + balance[2])
- GraphicsWindow.DrawBoundText(800, 420, 400, user[3] + " : " + bet[3] + " on " + bettype[3] + " " +" Remaining Balance: " + balance[3])
- GraphicsWindow.DrawBoundText(800, 480, 400, user[4] + " : " + bet[4] + " on " + bettype[4] + " " +" Remaining Balance: " + balance[4])
- GraphicsWindow.DrawBoundText(800, 540, 400, user[5] + " : " + bet[5] + " on " + bettype[5] + " " +" Remaining Balance: " + balance[5])
- GraphicsWindow.DrawBoundText(800, 600, 400, user[6] + " : " + bet[6] + " on " + bettype[6] + " " +" Remaining Balance: " + balance[6])
- GraphicsWindow.DrawBoundText(800, 660, 400, user[7] + " : " + bet[7] + " on " + bettype[7] + " " +" Remaining Balance: " + balance[7])
- GraphicsWindow.DrawBoundText(800, 720, 400, user[8] + " : " + bet[8] + " on " + bettype[8] + " " +" Remaining Balance: " + balance[8])
- Else
- bet[username] = 0
- TextWindow.WriteLine("Bet not accepted. Either over 100000000 or over balance or invalid.")
- TextWindow.Pause()
- TextWindow.Hide()
- EndIf
- Else
- TextWindow.WriteLine("This is not a valid option")
- TextWindow.Pause()
- TextWindow.Hide()
- EndIf
- EndIf
- EndIf
- EndIf
- Else
- TextWindow.WriteLine("INCORRECT PASSWORD")
- TextWindow.Pause()
- TextWindow.Hide()
- EndIf
- Else
- TextWindow.WriteLine("This is not a valid option")
- TextWindow.Pause()
- TextWindow.Hide()
- EndIf
- EndSub
- GraphicsWindow.MouseDown = OnMouseInput
- Sub OnMouseInput 'Starts a subroutine when the mouse is pressed
- randomnumber = Math.GetRandomNumber(54)
- If randomnumber>0 And randomnumber<27 Then
- spin = 2200
- For i = 1 To 8
- If bettype[i] = "Grey" Then
- balance[i] = balance[i] + bet[i]*2
- bet[i] = 0
- Else
- blank=0
- EndIf
- EndFor
- Else
- If randomnumber>26 And randomnumber<45 Then
- spin = 2050
- For i = 1 To 8
- If bettype[i] = "Blue" Then
- balance[i] = balance[i] + bet[i]*3
- bet[i] = 0
- Else
- blank=0
- EndIf
- EndFor
- Else
- If randomnumber>44 And randomnumber<54 Then
- spin = 2350
- For i = 1 To 8
- If bettype[i] = "Red" Then
- balance[i] = balance[i] + bet[i]*5
- bet[i] = 0
- Else
- blank=0
- EndIf
- EndFor
- Else
- If randomnumber=54 Then
- spin = 2155
- For i = 1 To 8
- If bettype[i] = "Gold" Then
- balance[i] = balance[i] + bet[i]*50
- bet[i] = 0
- Else
- blank=0
- EndIf
- EndFor
- Else
- GraphicsWindow.DrawBoundText(100, 100, 100, "Fail")
- EndIf
- EndIf
- EndIf
- EndIf
- File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance1.txt", 1, balance[1])
- File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance2.txt", 1, balance[2])
- File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance3.txt", 1, balance[3])
- File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance4.txt", 1, balance[4])
- File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance5.txt", 1, balance[5])
- File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance6.txt", 1, balance[6])
- File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance7.txt", 1, balance[7])
- File.WriteLine("C:\Users\Charlie\Desktop\Programming\csgold\balance8.txt", 1, balance[8])
- For i = 0 To spin
- Shapes.Rotate(image, 1 * i)
- Program.Delay(2)
- EndFor
- EndSub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement