Hi - first post here so sorry if I miss anything out.
Basically I want to call 2 subroutines several times in a row.
Rather than write them out again and again, I thought it would be easier to put them in a do loop.
Problem is, it seems to only do the do loop once and then exit.
So the do loop looks like this:
Do i=1,n
Write(*,*) i
Call Strategy(Player1s_Strategy,Player2s_Move,Player1s_Move)
Call Strategy(Player2s_Strategy,Player1s_Move,Player2s_Move)
End Do
Now the output is simply: 1
When it should be: 1
2
etc.
This seems to tell me that it is exiting the do loop prematurely. If I remove the call statements, it prints the correct expected output.
There are no problems with the program or subroutine as if I write the call statements out again and again, the program runs fine.
What is going on? And is there another way instead of writing out the call statements again and again...
Thank you all in advance for your help and I'm really sorry if I haven't been clear enough!
Basically I want to call 2 subroutines several times in a row.
Rather than write them out again and again, I thought it would be easier to put them in a do loop.
Problem is, it seems to only do the do loop once and then exit.
So the do loop looks like this:
Do i=1,n
Write(*,*) i
Call Strategy(Player1s_Strategy,Player2s_Move,Player1s_Move)
Call Strategy(Player2s_Strategy,Player1s_Move,Player2s_Move)
End Do
Now the output is simply: 1
When it should be: 1
2
etc.
This seems to tell me that it is exiting the do loop prematurely. If I remove the call statements, it prints the correct expected output.
There are no problems with the program or subroutine as if I write the call statements out again and again, the program runs fine.
What is going on? And is there another way instead of writing out the call statements again and again...
Thank you all in advance for your help and I'm really sorry if I haven't been clear enough!