VERSION 5.00
Begin VB.Form frm1 
   BackColor       =   &H00004080&
   Caption         =   "Бросание монеты"
   ClientHeight    =   2985
   ClientLeft      =   3990
   ClientTop       =   2985
   ClientWidth     =   4860
   LinkTopic       =   "Form1"
   ScaleHeight     =   2985
   ScaleWidth      =   4860
   Begin VB.TextBox txtN 
      Alignment       =   1  'Right Justify
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3120
      TabIndex        =   6
      Top             =   720
      Width           =   975
   End
   Begin VB.TextBox txtO 
      Alignment       =   1  'Right Justify
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   3720
      TabIndex        =   5
      Top             =   1320
      Width           =   972
   End
   Begin VB.TextBox txtR 
      Alignment       =   1  'Right Justify
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   3720
      TabIndex        =   2
      Top             =   1800
      Width           =   972
   End
   Begin VB.CommandButton cmd1 
      Caption         =   "Пуск"
      Height          =   372
      Left            =   600
      TabIndex        =   1
      Top             =   2520
      Width           =   1332
   End
   Begin VB.PictureBox pic1 
      BackColor       =   &H00FFFFFF&
      Height          =   2052
      Left            =   240
      ScaleHeight     =   1995
      ScaleWidth      =   1995
      TabIndex        =   0
      Top             =   240
      Width           =   2052
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      BackColor       =   &H00FFFFFF&
      Caption         =   "Количество бросаний"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2520
      TabIndex        =   7
      Top             =   240
      Width           =   2175
   End
   Begin VB.Label lblR 
      Alignment       =   2  'Center
      BackColor       =   &H00FFFFFF&
      Caption         =   "Орел"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2520
      TabIndex        =   4
      Top             =   1320
      Width           =   1095
   End
   Begin VB.Label lblN 
      Alignment       =   2  'Center
      BackColor       =   &H00FFFFFF&
      Caption         =   "Решка"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2520
      TabIndex        =   3
      Top             =   1800
      Width           =   1095
   End
End
Attribute VB_Name = "frm1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim dblX, dblY As Double, I, lngN, lngO, lngR As Long
Private Sub cmd1_Click()
lngO = 0
lngR = 0
lngN = txtN.Text
pic1.Cls
pic1.Scale (-2, 2)-(2, -2)
pic1.Line (-1, 1)-(1, -1), , B
'Генерация точек
For I = 1 To lngN
dblX = 2 * Rnd - 1
dblY = 2 * Rnd - 1
pic1.PSet (dblX, dblY)
If -1 <= dblX And dblX < 0 And -1 <= dblY And dblY <= 1 Then
lngO = lngO + 1
Else
lngR = lngR + 1
End If
Next I
txtO.Text = lngO
txtR.Text = lngR
'Ось X
pic1.Line (-1, 0)-(1, 0)
For I = -1 To 1
pic1.PSet (I, 0)
pic1.Print I
Next I
'Ось Y
pic1.Line (0, -1)-(0, 1)
For I = -1 To 1
pic1.PSet (0, I)
pic1.Print I
Next I
End Sub

