File: spirale

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (68 lines) | stat: -rw-r--r-- 1,518 bytes parent folder | download | duplicates (3)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
!if $wims_read_parm!=slib_header
 !goto proc
!endif

slib_author=Bernadette, Perrin-Riou
slib_require=pari
!exit

:proc
!reset slib_color slib_option
slib_texte=$wims_read_parm
!if $(wims_read_parm[-1])=html or $(wims_read_parm[-1])=url or $(wims_read_parm[-1])=raw
  slib_texte=$(wims_read_parm[1..-2])
  slib_option=$(wims_read_parm[-1])
!endif
slib_cnt=!charcnt $slib_texte
slib_N=$[(round(sqrt($slib_cnt))+1)^2]
slib_init=0

slib_c1=0
slib_c2=1
slib_c3=1
slib_size=$[round(sqrt($slib_N)/2)+2]
slib_size=-$slib_size,$slib_size
slib_Size=400,400
slib_dessin=xrange $slib_size\
yrange $slib_size\
linewidth 4
slib_deplac=1,0;0,1;-1,0;0,-1
slib_point=0,0
slib_dessin=$slib_dessin\
text black,$slib_point,giant,
slib_Point=$slib_point

!for slib_k=1+$slib_init to $slib_N+$slib_init
     slib_tr=$(slib_deplac[$slib_c1+1;])
     slib_point = !exec pari [$slib_point] + [$slib_tr]
     slib_Point=$slib_Point\
     $slib_point

     slib_l=!char $slib_k of $slib_texte
     slib_dessin=$slib_dessin\
text black, $slib_point, giant,$slib_l
     !if $slib_c3=$slib_c2
       !if $slib_c1%2!=0
         slib_c2=$[$slib_c2+1]
       !endif
       slib_c1=$[($slib_c1+1)%4]
       slib_c3=1
    !else
       slib_c3=$[$slib_c3+1]
    !endif
!next
slib_out=$slib_dessin

!if url iswordof $slib_option or html iswordof $slib_option
  insdraw_size=300,300
 !insdraw $slib_out
 slib_out=$ins_url
 !if html iswordof $slib_option
   slib_out=<img src="$ins_url" alt="">
 !else
   slib_out=$slib_out,$insdraw_size
 !endif
!endif