Compare commits

..

2 Commits

Author SHA1 Message Date
Tonton Th
cac6e89b00 add a new uselessgraphic: squarmania 2026-05-04 20:01:24 +02:00
Tonton Th
f302cf881a put intermediate files in WS/ 2026-05-03 20:00:19 +02:00
3 changed files with 71 additions and 10 deletions

1
.gitignore vendored
View File

@@ -11,4 +11,5 @@ starfield
randomwalk
oscilloscope
lissajous
squarmania

View File

@@ -13,8 +13,8 @@ starfield: starfield.f90 Makefile genplotting.o
starfield.png: starfield Makefile
./starfield
genplot2 -s 512x512 WS/starfield.scratch a.tga
convert a.tga $@
genplot2 -s 512x512 WS/starfield.scratch WS/a.tga
convert WS/a.tga $@
# -----------------------------------------------
@@ -23,8 +23,8 @@ randomwalk: randomwalk.f90 Makefile genplotting.o
randomwalk.png: randomwalk Makefile
./randomwalk
genplot2 -s 512x512 WS/randomwalk.scratch a.tga
convert a.tga $@
genplot2 -s 512x512 WS/randomwalk.scratch WS/a.tga
convert WS/a.tga $@
# -----------------------------------------------
@@ -33,8 +33,8 @@ oscilloscope: oscilloscope.f90 Makefile genplotting.o
oscilloscope.png: oscilloscope Makefile
./oscilloscope
genplot2 -s 512x512 WS/oscilloscope.scratch a.tga
convert a.tga $@
genplot2 -s 512x512 WS/oscilloscope.scratch WS/a.tga
convert WS/a.tga $@
# -----------------------------------------------
@@ -43,8 +43,8 @@ spirale: spirale.f90 Makefile genplotting.o
spirale.png: spirale Makefile
./spirale
genplot2 -s 512x512 WS/spirale.scratch a.tga
convert a.tga $@
genplot2 -s 512x512 WS/spirale.scratch WS/a.tga
convert WS/a.tga $@
# -----------------------------------------------
@@ -53,7 +53,17 @@ lissajous: lissajous.f90 Makefile genplotting.o
lissajous.png: lissajous Makefile
./lissajous
genplot2 -s 512x512 WS/lissajous.scratch a.tga
convert a.tga $@
genplot2 -s 512x512 WS/lissajous.scratch WS/a.tga
convert WS/a.tga $@
# -----------------------------------------------
squarmania: squarmania.f90 Makefile genplotting.o
gfortran -Wall $< genplotting.o -o $@
squarmania.png: squarmania Makefile
./squarmania
genplot2 -s 512x512 WS/squarmania.scratch WS/a.tga
convert WS/a.tga $@
# -----------------------------------------------

50
squarmania.f90 Normal file
View File

@@ -0,0 +1,50 @@
!
! SQUARMANIA
! new Thu Apr 23 04:27:03 PM UTC 2026
!
! this crapware is released by tTh under the
! DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
!
program squarmania
use genplotting
implicit none
write (0, '(A)') "----[ genplotting squarmania ]----"
call genp_init (0, 'WS/squarmania.scratch')
call do_squarmania (35, 0.93)
call genp_end (0)
contains
! ---------------------------------------------------------
subroutine do_squarmania (nbr, k0)
integer, intent(in) :: nbr
real, intent(in) :: k0
integer :: idx
real :: xa, xb, xc, xd, ya, yb, yc, yd
real :: va, vb, vc, vd, wa, wb, wc, wd, k2
k2 = 1.0 - k0
xa = 1 ; ya = 1 ; xb = 1 ; yb = -1
xc = -1 ; yc = -1 ; xd = -1 ; yd = 1
do idx=1, nbr
call genp_move(xa, ya)
call genp_draw(xb, yb, 1) ; call genp_draw(xc, yc, 2)
call genp_draw(xd, yd, 3) ; call genp_draw(xa, ya, 4)
va = k0*xa + k2*xb ; wa = k0*ya + k2*yb
vb = k0*xb + k2*xc ; wb = k0*yb + k2*yc
vc = k0*xc + k2*xd ; wc = k0*yc + k2*yd
vd = k0*xd + k2*xa ; wd = k0*yd + k2*ya
xa = va ; xb = vb ; xc = vc ; xd = vd
ya = wa ; yb = wb ; yc = wc ; yd = wd
enddo
end subroutine
! ---------------------------------------------------------
end program