-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDm1.f90
44 lines (36 loc) · 1.22 KB
/
Dm1.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
program Dm1_roller_EnJnDeSIgn2024
implicit none
character(len=1) :: user_input
integer :: selected_group, selected_number
character(len=5), dimension(0:1, 0:1) :: groups
character(len=5), dimension(2) :: group0, group1
real :: rand
Call random_seed()
! Display the progarm name and introduction
print *, "Dm1_roller_EnJnDeSIgn2024_??"
print *, "randomness fit for the gods "
print *, " by Ian J Norris "
print *, " [email protected] "
! Initialize group0
group0 = (/ " 0.00", "-0.01"/)
! Initialize group1
group1 = (/ " 0.50", " 0.01"/)
do while (.true.)
! Randomly select a group
call random_number(rand)
selected_group = int(rand * 2)
! Randomly select a number from the chosen group
call random_number(rand)
selected_number = int(rand * 2)
! Assian groups to the groups array
groups(0, :) = group0
groups(1, :) = group1
! display the selected number
print *, "from group ", selected_group, ": ", &
trim(groups(selected_group, selected_number))
print *, "roll again? (Y/N)"
read(*,*) user_input
if (user_input == 'N' .or. user_input == 'n') exit
end do
print *, "thank you for using the Dm1 roller."
end program Dm1_roller_EnJnDeSIgn2024