Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Greyscale-bars-Display/XPL0/greyscale-bars-display.xpl0
Normal file
16
Task/Greyscale-bars-Display/XPL0/greyscale-bars-display.xpl0
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
include c:\cxpl\codes; \intrinsic 'code' declarations
|
||||
int Q, N, W, B, C, Y;
|
||||
[SetVid($112); \640x480x24 graphics
|
||||
for Q:= 0 to 4-1 do \quarter of screen
|
||||
[N:= 8<<Q; \number of bars
|
||||
W:= 640/N; \width of bar (pixels)
|
||||
for B:= 0 to N-1 do \for each bar...
|
||||
[C:= fix(255.0/float(N-1) * float(if Q&1 then N-1-B else B));
|
||||
C:= C<<16 + C<<8 + C; \RGB color = gray
|
||||
for Y:= Q*120 to (Q+1)*120-1 do
|
||||
[Move(W*B, Y); Line(W*(B+1)-1, Y, C)];
|
||||
];
|
||||
];
|
||||
Q:= ChIn(1); \wait for keystroke
|
||||
SetVid(3); \restore normal text mode
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue