mirror of
https://github.com/ivabus/roulette
synced 2025-06-08 00:00:29 +03:00
Clearing code
This commit is contained in:
parent
9cd2aac5c4
commit
f86b9d41c4
1 changed files with 378 additions and 383 deletions
|
@ -19,13 +19,13 @@ Module Program
|
||||||
For i = 0 To UBound(mass)
|
For i = 0 To UBound(mass)
|
||||||
If mass(i) = obj Then Return i
|
If mass(i) = obj Then Return i
|
||||||
Next
|
Next
|
||||||
|
Return -1
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Sub displayHistory(history() As Integer)
|
Sub displayHistory(history() As Integer)
|
||||||
Console.ForegroundColor = ConsoleColor.DarkBlue
|
Console.ForegroundColor = ConsoleColor.DarkBlue
|
||||||
Console.Write("История выпадений (последние 10): ")
|
Console.Write("История выпадений (последние 15): ")
|
||||||
Dim start As Integer = If(Ubound(history) > 9, Ubound(history) - 10, 0)
|
For i = If(Ubound(history) > 14, Ubound(history) - 15, 0) To UBound(history)
|
||||||
For i = start To UBound(history)
|
|
||||||
Console.ForegroundColor = colors(ring(1,getindex(ringRank0, history(i))))
|
Console.ForegroundColor = colors(ring(1,getindex(ringRank0, history(i))))
|
||||||
Console.Write(history(i) & " ")
|
Console.Write(history(i) & " ")
|
||||||
Next
|
Next
|
||||||
|
@ -36,16 +36,10 @@ Module Program
|
||||||
Dim uBound = arr.GetUpperBound(0)
|
Dim uBound = arr.GetUpperBound(0)
|
||||||
Dim lBound = arr.GetLowerBound(0)
|
Dim lBound = arr.GetLowerBound(0)
|
||||||
Dim arrLen = uBound - lBound
|
Dim arrLen = uBound - lBound
|
||||||
|
|
||||||
If index < lBound OrElse index > uBound Then
|
|
||||||
Throw New ArgumentOutOfRangeException( _
|
|
||||||
String.Format("Index must be from {0} to {1}.", lBound, uBound))
|
|
||||||
Else
|
|
||||||
Dim outArr(arrLen - 1) As T
|
Dim outArr(arrLen - 1) As T
|
||||||
Array.Copy(arr, 0, outArr, 0, index)
|
Array.Copy(arr, 0, outArr, 0, index)
|
||||||
Array.Copy(arr, index + 1, outArr, index, uBound - index)
|
Array.Copy(arr, index + 1, outArr, index, uBound - index)
|
||||||
Return outArr
|
Return outArr
|
||||||
End If
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Sub sleep(d As Single)
|
Sub sleep(d As Single)
|
||||||
|
@ -60,23 +54,23 @@ Module Program
|
||||||
For i = 0 To UBound(intr)
|
For i = 0 To UBound(intr)
|
||||||
Console.WriteLine(intr(i))
|
Console.WriteLine(intr(i))
|
||||||
Console.SetCursorPosition(Console.WindowWidth \ 2 - Len(intr(0))\2, Console.GetCursorPosition().Item2)
|
Console.SetCursorPosition(Console.WindowWidth \ 2 - Len(intr(0))\2, Console.GetCursorPosition().Item2)
|
||||||
sleep(0.0888)
|
sleep(0.04444)
|
||||||
Next
|
Next
|
||||||
'sleep(5)
|
'sleep(5)
|
||||||
Console.SetCursorPosition(0,0)
|
Console.SetCursorPosition(0,0)
|
||||||
For i = 0 To (Console.WindowHeight()\2 - UBound(intr) + 2) \ 2
|
For i = 0 To (Console.WindowHeight()\2 - UBound(intr) + 2) \ 2
|
||||||
Console.WriteLine(StrDup(Console.WindowWidth-1, "#"))
|
Console.WriteLine(StrDup(Console.WindowWidth-1, "#"))
|
||||||
sleep(0.0888)
|
sleep(0.04444)
|
||||||
Next
|
Next
|
||||||
For i = 0 To Console.WindowHeight - (Console.WindowHeight()\2 - UBound(intr) + 2) - 3
|
For i = 0 To Console.WindowHeight - (Console.WindowHeight()\2 - UBound(intr) + 2) - 3
|
||||||
Console.Write(StrDup((Console.WindowWidth \ 2 - Len(intr(0)) \ 2) \ 2, "#"))
|
Console.Write(StrDup((Console.WindowWidth \ 2 - Len(intr(0)) \ 2) \ 2, "#"))
|
||||||
Console.SetCursorPosition(Console.WindowWidth - (Console.WindowWidth \ 2 - Len(intr(0)) \ 2) \ 2, (Console.GetCursorPosition().Item2))
|
Console.SetCursorPosition(Console.WindowWidth - (Console.WindowWidth \ 2 - Len(intr(0)) \ 2) \ 2, (Console.GetCursorPosition().Item2))
|
||||||
Console.WriteLine(StrDup((Console.WindowWidth \ 2 - Len(intr(0)) \ 2) \ 2 - 1, "#"))
|
Console.WriteLine(StrDup((Console.WindowWidth \ 2 - Len(intr(0)) \ 2) \ 2 - 1, "#"))
|
||||||
sleep(0.0888)
|
sleep(0.04444)
|
||||||
Next
|
Next
|
||||||
For i = 0 To (Console.WindowHeight()\2 - UBound(intr) + 2) \ 2
|
For i = 0 To (Console.WindowHeight()\2 - UBound(intr) + 2) \ 2
|
||||||
Console.WriteLine(StrDup(Console.WindowWidth-1, "#"))
|
Console.WriteLine(StrDup(Console.WindowWidth-1, "#"))
|
||||||
sleep(0.0888)
|
sleep(0.04444)
|
||||||
Next
|
Next
|
||||||
Dim entr As String = " Нажмите любую кнопку, чтобы начать игру! "
|
Dim entr As String = " Нажмите любую кнопку, чтобы начать игру! "
|
||||||
Console.SetCursorPosition((Console.WindowWidth \ 2) - Len(entr) \ 2,Console.WindowHeight - (Console.WindowHeight()\2 - UBound(intr) + 2) \ 4 - 1)
|
Console.SetCursorPosition((Console.WindowWidth \ 2) - Len(entr) \ 2,Console.WindowHeight - (Console.WindowHeight()\2 - UBound(intr) + 2) \ 4 - 1)
|
||||||
|
@ -100,6 +94,7 @@ Module Program
|
||||||
For k = 0 To rnd.Next(1,5)
|
For k = 0 To rnd.Next(1,5)
|
||||||
For i = 0 To rnd.Next(1,rnd.Next(5,100))
|
For i = 0 To rnd.Next(1,rnd.Next(5,100))
|
||||||
rnd.NextDouble()
|
rnd.NextDouble()
|
||||||
|
Randomize
|
||||||
Next
|
Next
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
@ -310,7 +305,7 @@ Module Program
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
Console.WriteLine("Крутим колесо...")
|
Console.WriteLine("Крутим колесо...")
|
||||||
sleep(2)
|
sleep(1)
|
||||||
display(Int(generated(0)))
|
display(Int(generated(0)))
|
||||||
Console.ForegroundColor = ConsoleColor.DarkBlue
|
Console.ForegroundColor = ConsoleColor.DarkBlue
|
||||||
Dim indedx As Integer
|
Dim indedx As Integer
|
||||||
|
|
Loading…
Reference in a new issue