From 42d066678dfa3edc69dcfb16fec1ccf194843fee Mon Sep 17 00:00:00 2001 From: Tonton Th Date: Sun, 17 May 2026 07:27:25 +0200 Subject: [PATCH] some adjustements, but need more work --- rndwlkng.f90 | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/rndwlkng.f90 b/rndwlkng.f90 index b0f845f..02928d9 100644 --- a/rndwlkng.f90 +++ b/rndwlkng.f90 @@ -11,27 +11,24 @@ program rndwlkng implicit none type walker - real :: xloc, yloc + real :: xloc, yloc ! where I am ? real :: heading ! direction in degrees - real :: powa + real :: powa ! correlated to nothing 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 srand(time()) call genp_init(0, "WS/rndwlkng.scratch") - do pass=1, 100 + do pass=1, 73 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) + drunky%heading = 360 * rand(0) + drunky%powa = 6.00 + call move_the_walker(drunky, 700, mod(pass, 6)+1) end do call genp_end(0) @@ -47,18 +44,15 @@ subroutine move_the_walker(bob, nbmove, col) 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)) + mv = 1.555 + (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) - + bob%heading = bob%heading + 42.42 * (rand(0) - 0.50000) call genp_draw(bob%xloc, bob%yloc, col) - enddo end subroutine