add some garbage

This commit is contained in:
tTh
2024-02-06 17:03:00 +01:00
parent ca899f5e90
commit ab23dc9897
14 changed files with 127 additions and 51 deletions

View File

@@ -2,7 +2,7 @@ program movebloubs
use bloubspace
use povstuff
use mathstuff
use mathstuff2
implicit none
@@ -14,8 +14,6 @@ program movebloubs
! logical :: add_new_bloub = .TRUE.
real :: rnd
call init_random_seed()
i = IARGC()
if (i .ne. 2) then
STOP ": BAD ARGS ON COMMAND LINE"
@@ -26,6 +24,8 @@ program movebloubs
write (0, '(A)') &
"### moving bloubs from "//trim(infile)//" to "//trim(outfile)
call init_random_seed()
open(newunit=inu, &
file=trim(infile), form='unformatted', &
iostat=errcode, &
@@ -61,10 +61,14 @@ program movebloubs
! moving, morphing and boundingboxing
call move_bloub (bloub, 0.185)
call bound_a_bloub (bloub)
if (bloub%radius .GT. 0.0238) then
if (bloub%radius .GT. 3.50) then
bloub%radius = bloub%radius * 0.999
endif
! if (bloub%radius .LT. 0.00015) then
! bloub%alive = .FALSE.
! endif
! XXX call green_soylent (bloub)
! XXX if (.NOT. bloub%alive) then
! XXX ! write(0, '(A)') " KILL!"
@@ -94,8 +98,15 @@ program movebloubs
! ok, we have read all the bloubs from the input file
! insert some fancy conditional here
if (compteur .LT. 200) then
call add_more_bloubs(outu, 5, 0.032)
if (compteur .LT. 50) then
call add_more_bloubs(outu, 5, 0.046)
endif
rnd = rand()
! write(0, *) 'rnd= ', rnd
if (rnd .LT. 0.18) then
write (0, *) '... random of life ...'
call add_more_bloubs(outu, 5, 0.056)
endif
close(inu) ; close(outu)
@@ -104,20 +115,22 @@ program movebloubs
contains
subroutine add_more_bloubs(un, nbre, rayon)
implicit none
integer, intent(in) :: un, nbre
real, intent(in) :: rayon
type(t_bloubs) :: bloub
integer :: foo, count
count = nbre+mod(irand(), 3)
write(0, '(A,I4,1X,A)') "movebloubs adding", count, "bloubs"
count = nbre+mod(irand(), 2)
write(0, '(1X,A,I0,1X,A)') "movebloubs: adding ", count, " bloubs"
do foo=1, count
bloub%nick = 'newbie '
call make_a_random_bloub(bloub, 7.12)
bloub%radius = rayon + (0.09*rand())
call make_a_random_bloub(bloub, 10.00)
bloub%radius = rayon + (0.11*rand())
bloub%age = 1
bloub%agemax = 160 + (count * 4)
bloub%alive = .TRUE.
bloub%num = mod(irand(), 42)
write(un) bloub ! no error control ?