Advertisement
ktostam450

BASIC MathLand

Dec 10th, 2012
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. start:
  2.  
  3. Dim numr As Integer
  4. Dim ile As Integer
  5. Dim k As String
  6. Dim scrtxt As String
  7. Dim la As Integer
  8. Dim lb As Integer
  9. Dim wyn As Integer
  10. Dim wf1 As Integer
  11. Dim znak As String
  12. Dim wf2 As Integer
  13. Dim x As Integer
  14. Dim pktp As Integer
  15. Dim punkty As Integer
  16. Cls
  17. scrtxt="                                                                        MathLand to gra, w ktorej sprawdzisz swoj matematyczny talent. Na ekranie beda wyswietlane rozne dzialania matematyczne, a ty bedziesz musial wybrac wlasciwa odpowiedz. W grze rozwiazujesz ile chcesz dzialan, za dzialania sa takie punkty: Dodawanie-1     Odejmowanie-2     Mnozenie-3     Dzielenie-4. Pozniej otrzymasz srednia punktow. Powodzenia zycza:  ruter  i  ktostam450 z grupy Polon Soft "
  18. Color (5,0)
  19. Locate 5,27
  20. Print "MathLand-instrukcja obslugi"
  21. Locate 9,22
  22. Print "Nacisnij spacje, jesli juz to czytales"
  23. Print
  24. Print "       Gra jest integralna czescia nakladki WinDOS grupy Polon Soft !"
  25. Print
  26. Print Tab (21);"Autorzy programu: ruter i ktostam450/pls"
  27. Do
  28. For pozs As Integer=0 To Len(scrtxt)
  29. Color (14,0)
  30. Locate 7,1
  31. Print Mid (scrtxt,pozs,80)
  32. k=InKey
  33. If k=" " Then GoTo gra
  34. Sleep (100,1)
  35. Next
  36. Loop
  37. Do
  38. gra:
  39. Cls
  40. Randomize Timer
  41. la=Int (20*Rnd)+4
  42. Randomize Timer
  43. lb=Int (20*Rnd)+6
  44. Randomize Timer
  45. x=Int (3*Rnd)
  46. Select Case x
  47. Case 0
  48. wyn=la+lb
  49. znak="+"
  50. pktp=1
  51. Case 1
  52. wyn=la-lb
  53. znak="-"
  54. pktp=2
  55. Case 2
  56. wyn=la*lb
  57. znak="*"
  58. pktp=3
  59. Case 3
  60. wyn=la/lb
  61. znak="/"
  62. pktp=4
  63. End Select
  64. Randomize Timer
  65. wf1=wyn+Int(Rnd*8)
  66. Randomize Timer
  67. wf2=wyn-Int(Rnd*12)+2
  68. Print "Runda:";numr;"     Punkty:"unkty
  69. Print "Dzialanie: "
  70. Print
  71. Color (14,0)
  72. Print la
  73. Color (10,0)
  74. Sleep (900,1)
  75. Print " ";znak
  76. Sleep (900,1)
  77. Color (14,0)
  78. Print lb
  79. Print
  80. Input "Ile to jest";ile
  81. If ile=wyn Then
  82. Print Chr(13);"Brawo!, otrzymujesz "ktp;" punktow"
  83. punkty=punkty+pktp
  84. Else
  85. Print Chr(13);"Zla odpowiedz, nie otrzymujesz punktow"
  86. EndIf
  87. Print
  88. Print "Nacisnij enter aby przejsc do kolejnej rundy, spc aby wyjsc"
  89. numr+=1
  90. Do
  91. k=InKey
  92. Loop until k<>""
  93. If k=Chr (13) Then GoTo f
  94. If k=" " Then GoTo pods
  95. f:
  96. Loop
  97. pods:
  98. Cls
  99. Print "Podsumowanie:"
  100. Print "Na ";numr;" pytan uzyskales punktow:"unkty
  101. Print "To jest "unkty/numr;" pkt za jedno pytanie."
  102. Print
  103. spr:
  104. Print "Chcesz zagrac jeszcze raz? (t/n,cr)"
  105. Input k
  106. k=UCase(k)
  107. If k="T" Then GoTo start
  108. If k="N" Then End
  109. GoTo spr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement