|
|
chas.BAS |
|
{* Часы *}REM basic' Часы SCREEN 9 {часы }COLOR 15, 1 first = 1 INPUT "input hours ", hour INPUT "input minutes {, min }If hour > 12 Then hour = hour - 12 CLS ox = 240 oy = 180 r = 160 rm = 145 rh = 100 rm0 = 170 gradhour = -90 + 360 / 12 * hour + 30 / 60 * min dhour = 0 For gradmin = -90 To 270 Step 6 {рисуем точки минут }ym = INT(56 / 70 * INT(rm0 * SIN(3.1415926# / 180 * gradmin))) xm = INT(rm0 * SQR(1 - (SIN(3.1415926# / 180 * gradmin) ^ 2))) If gradmin > 90 And gradmin < 270 Then xm = -xm xm = 310 + xm ym = 180 + ym CIRCLE (xm, ym), 2, 15 PAINT (xm, ym), 15, 15 Next gradmin For gradmin = -90 To 270 Step 30 {рисуем точки часов }ym = INT(56 / 70 * INT(rm0 * SIN(3.1415926# / 180 * gradmin))) xm = INT(rm0 * SQR(1 - (SIN(3.1415926# / 180 * gradmin) ^ 2))) If gradmin > 90 And gradmin < 270 Then xm = -xm xm = 310 + xm ym = 180 + ym CIRCLE (xm, ym), 6, 10 PAINT (xm, ym), 10, 10 Next gradmin { }Do For gradmin = -90 To 270 Step 6 If first = 1 Then first = 0 gradmin = -90 + 360 / 60 * min End If yh = INT(56 / 70 * INT(rh * SIN(3.1415926# / 180 * gradhour))) xh = INT(rh * SQR(1 - (SIN(3.1415926# / 180 * gradhour) ^ 2))) If gradhour > 90 And gradhour < 270 Then xh = -xh xh = 310 + xh yh = 180 + yh ym = INT(56 / 70 * INT(rm * SIN(3.1415926# / 180 * gradmin))) xm = INT(rm * SQR(1 - (SIN(3.1415926# / 180 * gradmin) ^ 2))) If gradmin > 90 And gradmin < 270 Then xm = -xm xm = 310 + xm ym = 180 + ym For grad = -90 To 270 Step 6 y = INT(56 / 70 * INT(r * SIN(3.1415926# / 180 * grad))) x = INT(r * SQR(1 - (SIN(3.1415926# / 180 * grad) ^ 2))) If grad > 90 And grad < 270 Then x = -x x = 310 + x y = 180 + y LINE (310, 180)-(xh, yh), 14 LINE (310, 180)-(xm, ym), 14 CIRCLE (310, 180), 6, 14 LINE (310, 180)-(x, y), 12 CIRCLE (310, 180), 3, 12 BEEP SLEEP 1 LINE (310, 180)-(x, y), 0 Next grad LINE (310, 180)-(xm, ym), 0 dhour = dhour + 1 If dhour = 2 Then {часовую стрелку двигать через 2 мин }gradhour = gradhour + 1 LINE (310, 180)-(xh, yh), 0 dhour = 0 If gradhour >= 270 Then gradhour = -90 End If Next gradmin Loop End 07.08.2014 - Breakpoint - точка остановки 07.08.2014 - Топ-10 самых популярных приложений в Facebook 18.11.2013 - Панель управления и персонализация системы. Windows Vista 18.11.2013 - Логические и физические диски. Windows Vista 18.11.2013 - Удаление файлов и папок 01.11.2013 - Программирование дисковых подсистем: возможности 31.10.2013 - Windows8 или Windows7? 31.10.2013 - Windows8, игры |
|
Non-commercial fansite
|