Compare commits
2 Commits
62012286ff
...
cac6e89b00
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cac6e89b00 | ||
|
|
f302cf881a |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,4 +11,5 @@ starfield
|
|||||||
randomwalk
|
randomwalk
|
||||||
oscilloscope
|
oscilloscope
|
||||||
lissajous
|
lissajous
|
||||||
|
squarmania
|
||||||
|
|
||||||
|
|||||||
30
Makefile
30
Makefile
@@ -13,8 +13,8 @@ starfield: starfield.f90 Makefile genplotting.o
|
|||||||
|
|
||||||
starfield.png: starfield Makefile
|
starfield.png: starfield Makefile
|
||||||
./starfield
|
./starfield
|
||||||
genplot2 -s 512x512 WS/starfield.scratch a.tga
|
genplot2 -s 512x512 WS/starfield.scratch WS/a.tga
|
||||||
convert a.tga $@
|
convert WS/a.tga $@
|
||||||
|
|
||||||
# -----------------------------------------------
|
# -----------------------------------------------
|
||||||
|
|
||||||
@@ -23,8 +23,8 @@ randomwalk: randomwalk.f90 Makefile genplotting.o
|
|||||||
|
|
||||||
randomwalk.png: randomwalk Makefile
|
randomwalk.png: randomwalk Makefile
|
||||||
./randomwalk
|
./randomwalk
|
||||||
genplot2 -s 512x512 WS/randomwalk.scratch a.tga
|
genplot2 -s 512x512 WS/randomwalk.scratch WS/a.tga
|
||||||
convert a.tga $@
|
convert WS/a.tga $@
|
||||||
|
|
||||||
# -----------------------------------------------
|
# -----------------------------------------------
|
||||||
|
|
||||||
@@ -33,8 +33,8 @@ oscilloscope: oscilloscope.f90 Makefile genplotting.o
|
|||||||
|
|
||||||
oscilloscope.png: oscilloscope Makefile
|
oscilloscope.png: oscilloscope Makefile
|
||||||
./oscilloscope
|
./oscilloscope
|
||||||
genplot2 -s 512x512 WS/oscilloscope.scratch a.tga
|
genplot2 -s 512x512 WS/oscilloscope.scratch WS/a.tga
|
||||||
convert a.tga $@
|
convert WS/a.tga $@
|
||||||
|
|
||||||
# -----------------------------------------------
|
# -----------------------------------------------
|
||||||
|
|
||||||
@@ -43,8 +43,8 @@ spirale: spirale.f90 Makefile genplotting.o
|
|||||||
|
|
||||||
spirale.png: spirale Makefile
|
spirale.png: spirale Makefile
|
||||||
./spirale
|
./spirale
|
||||||
genplot2 -s 512x512 WS/spirale.scratch a.tga
|
genplot2 -s 512x512 WS/spirale.scratch WS/a.tga
|
||||||
convert a.tga $@
|
convert WS/a.tga $@
|
||||||
|
|
||||||
# -----------------------------------------------
|
# -----------------------------------------------
|
||||||
|
|
||||||
@@ -53,7 +53,17 @@ lissajous: lissajous.f90 Makefile genplotting.o
|
|||||||
|
|
||||||
lissajous.png: lissajous Makefile
|
lissajous.png: lissajous Makefile
|
||||||
./lissajous
|
./lissajous
|
||||||
genplot2 -s 512x512 WS/lissajous.scratch a.tga
|
genplot2 -s 512x512 WS/lissajous.scratch WS/a.tga
|
||||||
convert 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
50
squarmania.f90
Normal 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
|
||||||
Reference in New Issue
Block a user