Pick random element: Difference between revisions
Content deleted Content added
add swift |
added Fortran |
||
Line 304:
> randomPick(lst)
</lang>
=={{header|Fortran}}==
{{works with|Fortran|90 and later}}
<lang fortran>program pick_random
implicit none
integer :: i
integer :: a(10) = (/ (i, i = 1, 10) /)
real :: r
call random_seed
call random_number(r)
write(*,*) a(int(r*size(a)) + 1)
end program</lang>
=={{header|Free Pascal}}==
|