diff --git a/.gitignore b/.gitignore index 16a1001..0f126b8 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ oscilloscope lissajous squarmania testbed +rndwlkng diff --git a/Makefile b/Makefile index b558f66..6a998bd 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,11 @@ testbed: testbed.f90 Makefile genplotting.o # ----------------------------------------------- +rndwlkng: rndwlkng.f90 Makefile genplotting.o + gfortran -Wall $< genplotting.o -o $@ + +# ----------------------------------------------- + starfield: starfield.f90 Makefile genplotting.o gfortran -Wall $< genplotting.o -o $@ diff --git a/rndwlkng.f90 b/rndwlkng.f90 new file mode 100644 index 0000000..b0f845f --- /dev/null +++ b/rndwlkng.f90 @@ -0,0 +1,67 @@ +! +! Random Walk Next Generation +! new Fri May 8 06:53:02 AM UTC 2026 +! +! this crapware is released by tTh under the +! DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE +! +! --------------------------------------------------------- +program rndwlkng + use genplotting + implicit none + + type walker + real :: xloc, yloc + real :: heading ! direction in degrees + real :: powa + end type walker + + type (walker) drunky + integer pass + + drunky%xloc = 0.00 + drunky%yloc = 0.00 + drunky%heading = 13.37 + drunky%powa = 4.00 + + call genp_init(0, "WS/rndwlkng.scratch") + + do pass=1, 100 + drunky%xloc = 5555 * (rand(0) - 0.50) + drunky%yloc = 5555 * (rand(0) - 0.50) + drunky%heading = 13.37 + drunky%powa = 4.00 + call move_the_walker(drunky, 1000, mod(pass, 5)+1) + end do + + call genp_end(0) + call genp_do_render("WS/rndwlkng.scratch", "rndwlkng.tga", 512, 512) + +contains +! --------------------------------------------------------- +subroutine move_the_walker(bob, nbmove, col) + type (walker), intent(inout) :: bob + integer, intent(in) :: nbmove, col + + integer :: idx + real :: rad, mv, dx, dy + + call genp_move(bob%xloc, bob%yloc) + + do idx=1, nbmove + rad = ( 3.141592654 * bob%heading ) / 180.0 + mv = 0.5 + (bob%powa * rand(0)) + dx = mv * sin(rad) + dy = mv * cos(rad) + bob%xloc = bob%xloc + dx + bob%yloc = bob%yloc + dy + bob%heading = bob%heading + 33 * (rand(0) - 0.50000) + + call genp_draw(bob%xloc, bob%yloc, col) + + enddo + +end subroutine +! --------------------------------------------------------- +end program +! ---------------------------------------------------------