DEFINT A-Z
SCREEN 12
' 16 базовых цветов
x = 0
FOR c = 0 TO 15
LINE (x, 0)-(x + 40, 20), c, BF
x = x + 40
NEXT
' Шкала оттенков
y = 25
FOR c1 = 0 TO 14
x = 0
FOR c2 = c1 + 1 TO 15
DrawBar x, y, x + 38, y + 20, c1, c2
x = x + 40
NEXT
y = y + 25
NEXT
a$ = INPUT$(1)
END
'/////////////////////////////////////////////////////////////////////
' Процедура для рисования закрашенного прямоугольника двумя оттенками
'/////////////////////////////////////////////////////////////////////
SUB DrawBar (x1, y1, x2, y2, c1, c2)
LINE (x1, y1)-(x2, y2), c2, BF
flag = 1
FOR y = y1 TO y2
IF flag = 1 THEN
LINE (x1, y)-(x2, y), c1, , &HAAAA
ELSE
LINE (x1 + 1, y)-(x2, y), c1, , &HAAAA
END IF
flag = -flag
NEXT
END SUB
Справочник алгоритмов v0.05 © 2007-2025 Igor Salnikov aka SunDoctor