BASIC (QB & etc) 4.07.2015 / 23:37 | | Gifo_Gsoul Пользователь Сейчас: Offline
Имя: Gifo_Gsoul Откуда: Ур Регистрация: 26.06.2014
| ВитаминКО, Да, запусти бейсик в бейсике, в бейсике, в бейсике .... __________________
</Твой код отражает эволюцию твоего мышления .../> |
27.03.2018 / 10:37 | | Витаминыч Супермодератор Сейчас: Offline
Имя: Василиус Откуда: RZN Регистрация: 20.04.2012
| REM Концентрация 0%
min = 0
REM Концентрация 10%
max = 10
REM Получение случайного значения от 0 до 10
randomNum = INT(RND * (max - min + 1)) + min
К вопросу из гостевой __________________
わからない!! |
19.07.2018 / 08:27 | | Vladimir1982 Пользователь Сейчас: Offline
Имя: Vladimir1982 Регистрация: 19.07.2018
| Я одно время писал на QBasic программы.
|
19.07.2018 / 09:21 | | Vladimir1982 Пользователь Сейчас: Offline
Имя: Vladimir1982 Регистрация: 19.07.2018
| Изменено Витаминыч (2.11 / 11:27) (всего 1 раз) |
14.09.2018 / 20:09 | | Vladimir1982 Пользователь Сейчас: Offline
Имя: Vladimir1982 Регистрация: 19.07.2018
| Нашел у себя в документах, 3D графика на QBASIC Открыть спойлер Закрыть спойлер DECLARE SUB CreateBackground ()
DECLARE SUB GetKeypress (Keycode%)
CONST UpArrow = -72, DnArrow = -80, LArrow = -75, RArrow = -77
RANDOMIZE TIMER
DIM Grid%(1 TO 12, 1 TO 12)
DIM STable!(0 - 31 TO 360 + 32), CTable!(0 - 31 TO 360 + 32)
DIM Textures(1 TO 15, 1 TO 4, 1 TO 30)
PX! = 9: PY! = 11 'the starting coordinates of the player's location
Stride! = 3 'the distance covered in one "step" by the player
' by pressing the up or down arrow keys
Heading% = 0 'the heading of the player (in degrees)
Turn% = 5 'number of degrees of rotation produced by
' pressing the right or left arrow keys
FOR Y% = 1 TO 12
FOR X% = 1 TO 12
READ Grid%(X%, Y%)
NEXT
NEXT
FOR TexturesL = 1 TO 15
FOR TexY% = 1 TO 30
FOR TexX% = 1 TO 4
READ Textures(TexturesL, TexX%, TexY%)
NEXT
NEXT
NEXT
Factor! = (ATN(1) * 8) / 360
FOR A% = 0 TO 359
Angle! = CSNG(A%) * Factor!
STable!(A%) = SIN(Angle!) * .1
CTable!(A%) = COS(Angle!) * .1
NEXT
FOR A% = -31 TO -1
STable!(A%) = STable!(A% + 360)
CTable!(A%) = CTable!(A% + 360)
NEXT
FOR A% = 360 TO 360 + 32
STable!(A%) = STable!(A% - 360)
CTable!(A%) = CTable!(A% - 360)
NEXT
SCREEN 7, , 0, 0
PRINT
PRINT
PRINT " 3D à®£à ¬¬ "
PRINT
PRINT " UP ARROW........¯¥àñ€"
PRINT " DOWN ARROW...... § €"
PRINT " RIGHT ARROW.....«¥¢®"
PRINT " LEFT ARROW......¯à ¢®"
PRINT
PRINT
PRINT " ®Š «ª©áâ ,¯®€®Š€šâ¥...";
CALL CreateBackground
BEEP
LOCATE , 1
PRINT " Š¬šâ¥ «î¡ãî ª« ¢šèã...";
DO WHILE LEN(INKEY$): LOOP: DO UNTIL LEN(INKEY$): LOOP
ViewPg% = 0: WorkPg% = 1: BG1% = 2: BG2% = 3
SCREEN , , WorkPg%, ViewPg%
GOSUB ComputeView
DO 'Main loop
CALL GetKeypress(Keycode%)
SELECT CASE Keycode%
CASE LArrow
Heading% = (Heading% + Turn%) MOD 360
GOSUB ComputeView
CASE RArrow
Heading% = (Heading% + (360 - Turn%)) MOD 360
GOSUB ComputeView
CASE UpArrow
NewPX! = PX! - (STable!(Heading%) * Stride!)
NewPY! = PY! - (CTable!(Heading%) * Stride!)
IF Grid%(NewPX!, NewPY!) = 0 THEN
PX! = NewPX!: PY! = NewPY!
GOSUB ComputeView
ELSE 'tried to walk through a wall
SOUND 80, 1
END IF
CASE DnArrow
NewPX! = PX! + (STable!(Heading%) * Stride!)
NewPY! = PY! + (CTable!(Heading%) * Stride!)
IF Grid%(NewPX!, NewPY!) = 0 THEN
PX! = NewPX!: PY! = NewPY!
GOSUB ComputeView
ELSE 'tried to walk through a wall
SOUND 80, 1
END IF
CASE 27
EXIT DO
CASE ELSE
BEEP
END SELECT
LOOP
SCREEN 0: WIDTH 80, 25
END
ComputeView:
PCOPY BG1%, WorkPg%: SWAP BG1%, BG2%
X1% = 0
FOR A% = Heading% + 32 TO Heading% - 31 STEP -1
StepX! = STable!(A%): StepY! = CTable!(A%)
XX! = PX!: YY! = PY!
L% = 0
DO
XX! = XX! - StepX!: YY! = YY! - StepY!
L% = L% + 1
K% = Grid%(XX!, YY!)
LOOP UNTIL K%
DD% = 900 \ L%
H% = DD% + DD%
DT% = 100 - DD%
ymoves = 0
FOR Y = DT% TO DT% + H% STEP (H%) / 30
ymoves = ymoves + 1
FOR X = 1 TO 4
IF ymoves > 30 THEN ymoves = 30
LINE (X1% + X, DT% + ((ymoves - 1) * (H%) / 30))-(X1% + X + 1, DT% + ((ymoves) * (H%) / 30)), Textures(K%, X, ymoves), B
NEXT
NEXT
'LINE (X1%, DT%)-STEP(4, H%), K%, BF
X1% = X1% + 5
NEXT
SWAP WorkPg%, ViewPg%
SCREEN , , WorkPg%, ViewPg%
RETURN
' Level data
DATA 9, 1, 9, 1, 1, 1, 1, 1, 1, 1, 9, 1
DATA 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9
DATA 9, 0, 2, 10, 0, 0, 0, 0, 0, 0, 0, 1
DATA 1, 0, 10, 2, 0, 0, 0, 0, 0, 0, 0, 9
DATA 9, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 1
DATA 1, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 9
DATA 9, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 1
DATA 1, 0, 13, 0, 0, 4, 0, 0, 0, 12, 0, 9
DATA 9, 0, 5, 0, 0, 5, 0, 0, 0, 0, 0, 1
DATA 1, 0, 13, 0, 0, 0, 0, 0, 0, 12, 0, 9
DATA 9, 0, 5, 0, 0, 0, 0, 0, 0, 4, 0, 1
DATA 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9
'Texture data
'Text. 1
DATA 0, 8, 0, 0
DATA 8, 7, 8,
DATA 7, 7, 7, 8
DATA 7, 7, 7, 8
DATA 8, 8, 8, 0
DATA 8, 7,8,0
DATA 8, 7,8,0
DATA 8, 7,8,0
DATA 8, 7,8,0
DATA 8, 7,8,0
DATA 8, 7,8,0
DATA 8, 7,8,0
DATA 8, 8,8,8
DATA 7, 7,7,7
DATA 8, 8,8,8
DATA 8, 7,8,0
DATA 8, 7,8,0
DATA 8, 7,8,0
DATA 8, 7,8,0
DATA 8, 7,8,0
DATA 8, 7,8,0
DATA 8, 7,8,0
DATA 8, 7,8,0
DATA 8, 7,8,0
DATA 8, 7, 8, 0
DATA 8, 7, 8,2
DATA 8, 2, 8, 2
DATA 2, 10, 2, 2
DATA 2, 2, 10, 2
DATA 2, 2, 2, 2
'Text. 2
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
DATA 8, 7, 8, 7
DATA 7, 7, 7, 7
DATA 7, 15, 7, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 7, 15, 7, 15
DATA 7, 7, 7, 7
DATA 8, 7, 8, 7
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
'Text. 3
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
DATA 8, 7, 8, 7
DATA 7, 7, 7, 7
DATA 7, 15, 7, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 7, 15, 7, 15
DATA 7, 7, 7, 7
DATA 8, 7, 8, 7
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
'Text. 4
DATA 4, 4, 4, 4
DATA 4, 8, 4, 8
DATA 8, 7, 8, 7
DATA 7, 7, 7, 7
DATA 7, 15, 7, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 7, 15, 7, 15
DATA 7, 7, 7, 7
DATA 8, 7, 8, 7
DATA 4, 8, 4, 8
DATA 4, 4, 4, 4
'Text. 5
DATA 4, 8, 4, 8
DATA 8, 8, 8, 8
DATA 8, 7, 8, 7
DATA 7, 7, 7, 7
DATA 7, 15, 7, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 7, 15, 7, 15
DATA 7, 7, 7, 7
DATA 8, 7, 8, 7
DATA 8, 8, 8, 8
DATA 8, 4, 8, 4
'Text. 6
DATA 4, 6, 4, 6
DATA 4, 4, 4, 4
DATA 8, 4, 8, 4
DATA 7, 7, 7, 7
DATA 7, 15, 7, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 7, 15, 7, 15
DATA 7, 7, 7, 7
DATA 4, 7, 4, 7
DATA 4, 4, 4, 4
DATA 4, 6, 4, 6
'Text. 7
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
DATA 8, 7, 8, 7
DATA 7, 7, 7, 7
DATA 7, 15, 7, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 7, 15, 7, 15
DATA 7, 7, 7, 7
DATA 8, 7, 8, 7
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
'Text. 8
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
DATA 8, 7, 8, 7
DATA 7, 7, 7, 7
DATA 7, 15, 7, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 7, 15, 7, 15
DATA 7, 7, 7, 7
DATA 8, 7, 8, 7
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
'Text. 9
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
DATA 8, 7, 8, 7
DATA 7, 7, 7, 7
DATA 7, 15, 7, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 7, 15, 7, 15
DATA 7, 7, 7, 7
DATA 8, 7, 8, 7
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
'Text. 10
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
DATA 8, 7, 8, 7
DATA 7, 7, 7, 7
DATA 7, 15, 7, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 7, 15, 7, 15
DATA 7, 7, 7, 7
DATA 8, 7, 8, 7
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
'Text. 11
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
DATA 8, 7, 8, 7
DATA 7, 7, 7, 7
DATA 7, 15, 7, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 7, 15, 7, 15
DATA 7, 7, 7, 7
DATA 8, 7, 8, 7
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
'Text. 12
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
DATA 8, 7, 8, 7
DATA 7, 7, 7, 7
DATA 7, 15, 7, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 7, 15, 7, 15
DATA 7, 7, 7, 7
DATA 8, 7, 8, 7
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
'Text. 13
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
DATA 8, 7, 8, 7
DATA 7, 7, 7, 7
DATA 7, 15, 7, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 7, 15, 7, 15
DATA 7, 7, 7, 7
DATA 8, 7, 8, 7
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
'Text. 14
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
DATA 8, 7, 8, 7
DATA 7, 7, 7, 7
DATA 7, 15, 7, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 7, 15, 7, 15
DATA 7, 7, 7, 7
DATA 8, 7, 8, 7
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
'Text. 15
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
DATA 8, 7, 8, 7
DATA 7, 7, 7, 7
DATA 7, 15, 7, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 15, 15, 15, 15
DATA 7, 15, 7, 15
DATA 7, 7, 7, 7
DATA 8, 7, 8, 7
DATA 8, 8, 8, 8
DATA 8, 8, 8, 8
DEFINT A-Z
DEFSNG A-Z
SUB CreateBackground
SCREEN , , 2, 0: CLS
' Sky
LINE (0, 0)-(319, 99), 0, BF
' Moon (Prev. a Sun)
CIRCLE (50, 30), 10, 8: PAINT (50, 30), 14, 8
'CIRCLE (53, 27), 2, 8: PAINT (53, 27), 8, 8
CIRCLE (43, 29), 10, 0: PAINT (43, 29), 0, 0
' Clouds moved after moon so they would overlap it
FOR Cnt% = 1 TO 10
X% = INT(RND * 320)
Y% = INT(RND * 80) + 10
R% = INT(RND * 50)
AR! = RND / 10
CIRCLE (X%, Y%), R%, 15, , , AR!: PAINT (X%, Y%), 15
NEXT
'Building (gray)
LINE (200, 20)-(220, 15), 8
LINE (220, 15)-(240, 20), 8
LINE (200, 20)-(200, 99), 8
LINE (240, 20)-(240, 99), 8
LINE (200, 99)-(240, 99), 8
PAINT (220, 50), 8
FOR Cnt% = 1 TO 20 ' Lights
PSET (INT(RND * 38 + 201), INT(RND * 80 + 20)), 14
NEXT
LINE (200, 20)-(220, 15), 0 ' Building (border)
LINE (220, 15)-(240, 20), 0
LINE (219, 15)-(219, 99), 0
LINE (200, 20)-(200, 99), 0
LINE (240, 20)-(240, 99), 0
PCOPY 2, 3
FOR Y% = 100 TO 199
FOR X% = 0 TO 319
IF RND AND 1 THEN PSET (X%, Y%), 8
NEXT
NEXT
SCREEN , , 3, 0
FOR Y% = 100 TO 199
FOR X% = 0 TO 319
IF RND AND 1 THEN PSET (X%, Y%), 8
NEXT
NEXT
SCREEN , , 0, 0
END SUB
DEFINT A-Z
SUB GetKeypress (Keycode%)
DO: Ky$ = INKEY$: LOOP UNTIL LEN(Ky$)
Keycode% = ASC(Ky$): IF Keycode% = 0 THEN Keycode% = -ASC(MID$(Ky$, 2, 1))
END SUB
Изменено Magatino (14.09 / 21:36) (всего 2 раза) |
17.09.2018 / 14:25 | | Vladimir1982 Пользователь Сейчас: Offline
Имя: Vladimir1982 Регистрация: 19.07.2018
| Перемещение смайлика по осям X, Y: w - верх s - вниз a - влево d - вправо SCREEN 12
DIM Smile(100)
DATA 0,0,0,14,14,14,14,0,0,0
DATA 0,0,14,14,14,14,14,14,0,0
DATA 0,14,0,0,14,14,0,0,14,0
DATA 14,14,0,0,14,14,0,0,14,14
DATA 14,14,0,0,14,14,0,0,14,14
DATA 14,14,14,14,14,14,14,14,14,14
DATA 14,14,0,0,0,0,0,0,14,14
DATA 0,14,14,0,0,0,0,14,14,0
DATA 0,0,14,14,0,0,14,14,0,0
DATA 0,0,0,14,14,14,14,0,0,0
FOR y = 0 TO 9: FOR x = 0 TO 9
READ c: PSET (x, y), c: NEXT x, y
GET (0, 0)-(9, 9), Smile
CLS : y = 220: x = 320: PUT (x, y), Smile
DO
k$ = INKEY$
IF k$ = "w" THEN PUT (x, y), Smile: y = y - 3: PUT (x, y), Smile
IF k$ = "s" THEN PUT (x, y), Smile: y = y + 3: PUT (x, y), Smile
IF k$ = "a" THEN PUT (x, y), Smile: x = x - 3: PUT (x, y), Smile
IF k$ = "d" THEN PUT (x, y), Smile: x = x + 3: PUT (x, y), Smile
LOOP
Изменено Vladimir1982 (17.09 / 14:33) (всего 2 раза) |
17.09.2018 / 17:10 | | Vladimir1982 Пользователь Сейчас: Offline
Имя: Vladimir1982 Регистрация: 19.07.2018
| DO WHILE INKEY$ = ""
SCREEN 13
FOR i = 1 TO 100
PSET (RND * 340, RND * 230), i
FOR a = 1 TO 100
PSET (RND * 350, RND * 340), 0
NEXT a, i
LOOP
|
17.09.2018 / 21:59 | | Витаминыч Супермодератор Сейчас: Offline
Имя: Василиус Откуда: RZN Регистрация: 20.04.2012
| Боже, вспомнилось, как я тупил с этими data и их считыванием... Такой гемор, что проще было в массив запихнуть __________________
わからない!! |
18.09.2018 / 15:09 | | Vladimir1982 Пользователь Сейчас: Offline
Имя: Vladimir1982 Регистрация: 19.07.2018
| Цитата Витаминыч: Боже, вспомнилось, как я тупил с этими data и их считыванием... Такой гемор, что проще было в массив запихнуть Так там и есть массив. |
19.09.2018 / 19:41 | | Витаминыч Супермодератор Сейчас: Offline
Имя: Василиус Откуда: RZN Регистрация: 20.04.2012
| Vladimir1982, Я про то, что я так никогда не записывал данные, сразу или в файл или в массив. Оператор data не использовал
__________________
わからない!! |
Всего сообщений: 33 Фильтровать сообщения Поиск по теме
|