Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,21 @@
|
|||
' FB 1.05.0 Win64
|
||||
|
||||
' Draw the color bars on an 80 x 25 console using the system palette of 16 colors
|
||||
' i.e. 5 columns per color
|
||||
Width 80, 25
|
||||
Shell "cls"
|
||||
Locate ,, 0 '' turn cursor off
|
||||
For clr As UInteger = 0 To 15
|
||||
Color 0, clr
|
||||
For row As Integer = 1 to 25
|
||||
For col As UInteger = 1 To 5
|
||||
Locate row, clr * 5 + 1
|
||||
Print Space(5);
|
||||
Next col
|
||||
Next row
|
||||
Next clr
|
||||
|
||||
Sleep
|
||||
' restore default settings
|
||||
Locate ,, 1 '' turn cursor on
|
||||
Color 7, 0 '' white text on black background
|
||||
59
Task/Colour-bars-Display/Ring/colour-bars-display.ring
Normal file
59
Task/Colour-bars-Display/Ring/colour-bars-display.ring
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
load "guilib.ring"
|
||||
|
||||
new qapp
|
||||
{
|
||||
win1 = new qwidget() {
|
||||
setwindowtitle("drawing using qpainter")
|
||||
setwinicon(self,"C:\Ring\bin\image\browser.png")
|
||||
setgeometry(100,100,500,600)
|
||||
label1 = new qlabel(win1) {
|
||||
setgeometry(10,10,400,400)
|
||||
settext("")
|
||||
}
|
||||
new qpushbutton(win1) {
|
||||
setgeometry(200,400,100,30)
|
||||
settext("draw")
|
||||
setclickevent("draw()")
|
||||
}
|
||||
show()
|
||||
}
|
||||
exec()
|
||||
}
|
||||
|
||||
func draw
|
||||
p1 = new qpicture()
|
||||
color = new qcolor() {
|
||||
setrgb(0,0,255,255)
|
||||
}
|
||||
pen = new qpen() {
|
||||
setcolor(color)
|
||||
setwidth(1)
|
||||
}
|
||||
new qpainter() {
|
||||
begin(p1)
|
||||
setpen(pen)
|
||||
|
||||
//Black, Red, Green, Blue, Magenta, Cyan, Yellow, White
|
||||
|
||||
for n = 1 to 8
|
||||
color2 = new qcolor(){
|
||||
switch n
|
||||
on 1 r=0 g=0 b=0
|
||||
on 2 r=255 g=0 b=0
|
||||
on 3 r=0 g=255 b=0
|
||||
on 4 r=0 g=0 b=255
|
||||
on 5 r=255 g=0 b=255
|
||||
on 6 r=0 g=255 b=255
|
||||
on 7 r=255 g=255 b=0
|
||||
on 8 r=255 g=255 b=255
|
||||
off
|
||||
setrgb(r,g,b,255)
|
||||
}
|
||||
mybrush = new qbrush() {setstyle(1) setcolor(color2)}
|
||||
setbrush(mybrush)
|
||||
drawrect(n*25,25,25,70)
|
||||
next
|
||||
|
||||
endpaint()
|
||||
}
|
||||
label1 { setpicture(p1) show() }
|
||||
24
Task/Colour-bars-Display/Sidef/colour-bars-display.sidef
Normal file
24
Task/Colour-bars-Display/Sidef/colour-bars-display.sidef
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
require('GD');
|
||||
|
||||
var colors = Hash.new(
|
||||
white => [255, 255, 255],
|
||||
red => [255, 0, 0],
|
||||
green => [0, 255, 0],
|
||||
blue => [0, 0, 255],
|
||||
magenta => [255, 0, 255],
|
||||
yellow => [255, 255, 0],
|
||||
cyan => [0, 255, 255],
|
||||
black => [0, 0, 0],
|
||||
);
|
||||
|
||||
var barwidth = 160/8;
|
||||
var image = %s'GD::Image'.new(160, 100);
|
||||
var start = 0;
|
||||
|
||||
colors.values.each { |rgb|
|
||||
var paintcolor = image.colorAllocate(rgb...);
|
||||
image.filledRectangle(start * barwidth, 0, start*barwidth + barwidth - 1, 99, paintcolor);
|
||||
start++;
|
||||
};
|
||||
|
||||
%f'colorbars.png'.open('>:raw').print(image.png);
|
||||
Loading…
Add table
Add a link
Reference in a new issue