Created
May 27, 2024 17:59
-
-
Save mrdoornbos/0aef0c20773273051c2ef248a5844297 to your computer and use it in GitHub Desktop.
classic 10 print in gfortran, just for the haters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program ten_print | |
implicit none | |
integer :: i, j | |
integer, parameter :: n = 40 | |
call random_seed() | |
do i = 1, n | |
do j = 1, n | |
if (rand() < 0.5) then | |
write(*, "(A)", advance="no") "/" | |
else | |
write(*, "(A)", advance="no") "\" | |
end if | |
end do | |
write(*,*) "" | |
end do | |
end program ten_print | |
real function rand() | |
real :: r | |
call random_number(r) | |
rand = r | |
end function rand |
Author
mrdoornbos
commented
May 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment