bloubworld: more tweaking, more pimping
This commit is contained in:
@@ -48,6 +48,9 @@ program movebloubs
|
||||
compteur = 0
|
||||
killed = 0
|
||||
|
||||
!-
|
||||
! begin of bigloop
|
||||
!-
|
||||
do
|
||||
read (unit=inu, iostat=errcode) bloub
|
||||
if (0 .ne. errcode) then
|
||||
@@ -59,14 +62,14 @@ program movebloubs
|
||||
call move_bloub (bloub, 0.185)
|
||||
call bound_a_bloub (bloub)
|
||||
if (bloub%radius .GT. 0.0238) then
|
||||
bloub%radius = bloub%radius * 0.996
|
||||
bloub%radius = bloub%radius * 0.999
|
||||
endif
|
||||
|
||||
call green_soylent (bloub)
|
||||
if (.NOT. bloub%alive) then
|
||||
! write(0, '(A)') " KILL!"
|
||||
killed = killed + 1
|
||||
endif
|
||||
! XXX call green_soylent (bloub)
|
||||
! XXX if (.NOT. bloub%alive) then
|
||||
! XXX ! write(0, '(A)') " KILL!"
|
||||
! XXX killed = killed + 1
|
||||
! XXX endif
|
||||
|
||||
! calcul du barycentre
|
||||
bx = bx + dble(bloub%px)
|
||||
@@ -84,33 +87,18 @@ program movebloubs
|
||||
enddo ! end of main loop
|
||||
|
||||
write(0, '(1X,I0,1X,A)') compteur, "bloubs processed"
|
||||
|
||||
! ok, we have read all the bloubs in the input file
|
||||
|
||||
! insert some fancy conditional here
|
||||
if (compteur .LT. 200) then
|
||||
call add_more_bloubs(outu, 4, 0.026)
|
||||
endif
|
||||
|
||||
! insert some very fancy conditional here
|
||||
if (compteur .LT. 800) then
|
||||
rnd = rand()
|
||||
! write (0, '(A,1X,F9.6)') "try to add bloubs, rnd is", rnd
|
||||
if (rnd .LT. 0.0604) then
|
||||
call add_more_bloubs(outu, 11, 0.019)
|
||||
endif
|
||||
endif
|
||||
|
||||
close(inu) ; close(outu)
|
||||
|
||||
if (killed .GT. 0) then
|
||||
write (0, '(1X,I0,A)') killed, " bloubs killed"
|
||||
endif
|
||||
|
||||
bx = bx / dble(compteur)
|
||||
by = by / dble(compteur)
|
||||
bz = bz / dble(compteur)
|
||||
write (0, '(A,3(F12.6,3X))') "barycentre : ", bx, by, bz
|
||||
! 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)
|
||||
endif
|
||||
|
||||
close(inu) ; close(outu)
|
||||
|
||||
! --------------------------------------------------------------
|
||||
contains
|
||||
@@ -121,14 +109,14 @@ contains
|
||||
type(t_bloubs) :: bloub
|
||||
integer :: foo, count
|
||||
|
||||
count = nbre+mod(irand(), 6)
|
||||
write(0, '(A,I4,1X,A)') "adding", count, "bloubs"
|
||||
count = nbre+mod(irand(), 3)
|
||||
write(0, '(A,I4,1X,A)') "movebloubs adding", count, "bloubs"
|
||||
|
||||
do foo=1, count
|
||||
|
||||
bloub%nick = 'newbie '
|
||||
call make_a_random_bloub(bloub)
|
||||
bloub%radius = rayon + (0.05*rand())
|
||||
call make_a_random_bloub(bloub, 7.12)
|
||||
bloub%radius = rayon + (0.09*rand())
|
||||
bloub%age = 1
|
||||
bloub%alive = .TRUE.
|
||||
bloub%num = mod(irand(), 42)
|
||||
|
||||
Reference in New Issue
Block a user