42 lines
1.1 KiB
Fortran
42 lines
1.1 KiB
Fortran
! -------------------------------------------------------------------
|
|
!- fonctions diverses pour faire des images bizarres
|
|
! -------------------------------------------------------------------
|
|
|
|
module utils_ga
|
|
use pixrgb
|
|
implicit none
|
|
|
|
contains
|
|
|
|
! -------------------------------------------------------------------
|
|
function fair_random_dice()
|
|
integer :: fair_random_dice
|
|
|
|
fair_random_dice = 1 + int(rand()*6.0)
|
|
|
|
end function
|
|
! -------------------------------------------------------------------
|
|
! usage --> see doublegauss.f90
|
|
function fair_random_gauss(hilevel)
|
|
integer, intent(in) :: hilevel
|
|
integer :: fair_random_gauss
|
|
integer :: foo, bar
|
|
|
|
foo = int(rand()*hilevel/2)
|
|
bar = int(rand()*hilevel/2)
|
|
fair_random_gauss = 1 + foo + bar
|
|
|
|
end function
|
|
! -------------------------------------------------------------------
|
|
! usage --> see doublegauss.f90
|
|
subroutine increment_pixel(pix, k)
|
|
type(t_pixrgb), intent(inout) :: pix
|
|
integer :: k
|
|
|
|
|
|
|
|
end subroutine
|
|
! -------------------------------------------------------------------
|
|
|
|
end module
|