File: moving_squares.kbs

package info (click to toggle)
basic256 2.0.99.10-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,888 kB
  • sloc: cpp: 17,185; yacc: 4,025; lex: 1,466; java: 1,091; sh: 39; xml: 33; makefile: 20
file content (43 lines) | stat: -rw-r--r-- 658 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
rem Moving Squares thanks to Joel Kahn

clg
x1=150
y1=150
q=0.055
m=0.0

while 1
   m=m+q
   x1=x1+4.0*cos(m)
   y1=y1+4.0*sin(m)
   x2=300-x1
   y2=300-y1
   x3=x1/2.0
   y3=y1/2.0
   x4=300-x3
   y4=300-y3
   color purple
   line x1,y1,x2,y1
   color orange
   line x1,y1,x1,y2
   color darkpurple
   line x1,y2,x2,y2
   color darkorange
   line x2,y1,x2,y2
   color blue
   line x3,y3,x1,y1
   color darkblue
   line x2,y2,x4,y4
   color cyan
   line x3,y4,x1,y2
   color darkcyan
   line x2,y1,x4,y3
   color green
   line x3,y3,x3,y4
   color red
   line x3,y3,x4,y3
   color darkgreen
   line x4,y3,x4,y4
   color darkred
   line x3,y4,x4,y4
end while