tag:blogger.com,1999:blog-7612793.post2143360885334638829..comments2024-03-27T23:59:49.801+00:00Comments on Stoat: Fortran puzzle!William M. Connolleyhttp://www.blogger.com/profile/05836299130680534926noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-7612793.post-43505699811073586972018-04-16T04:23:22.214+00:002018-04-16T04:23:22.214+00:00BTW, I 1st learned FORTRAN in the fall of 1975 (IB...BTW, I 1st learned FORTRAN in the fall of 1975 (IBM 360 with little donuts for memory). I 1st learned BASIC in the fall of 1972 (self taught 18 years old Dartmouth timeshare while at VTC). There were no computer courses at the time I went to HS (I only did NC punched tape in technical drafting, that would take me back to circa 1970).Everett F Sargenthttps://www.blogger.com/profile/00201577558036010680noreply@blogger.comtag:blogger.com,1999:blog-7612793.post-82972040077251231472018-04-16T04:01:52.859+00:002018-04-16T04:01:52.859+00:00Yup.
I use the Intel FORTRAN compiler ,,,
https:...Yup.<br /><br />I use the Intel FORTRAN compiler ,,, <br />https://software.intel.com/en-us/node/679437<br /><br />"NOTE<br />No additional statement can be placed after the IF THEN statement in a block IF construct. For example, the following statement is invalid in the block IF construct:<br /><br /> IF (e) THEN I = J<br />This statement is translated as the following logical IF statement:<br /><br /> IF (e) THENI = J"<br /><br />If I thought that that if then construct was even valid, I would have said so (and the answer would have been 49 instead of 42). But then I already knew that it wasn't, didn't think it was of any value, since it does nothing relative to the 'RESULT=',X statement. And no, I just looked it up like 10 seconds ago (but I already knew it was not a proper if/then construct and that it will still get through the compiler anyways).<br /><br />I go back with that particular compiler to when DEC owned it (very early 1983 is when I 1st used it).Everett F Sargenthttps://www.blogger.com/profile/00201577558036010680noreply@blogger.comtag:blogger.com,1999:blog-7612793.post-35577140494045419272018-04-15T20:51:04.879+00:002018-04-15T20:51:04.879+00:00if you mean that ...
IF (X .LT. 60.) THEN X = X +...if you mean that ... <br />IF (X .LT. 60.) THEN X = X + 7.<br /><br />... is ... <br /><br />IF(X.LT.60.)THENX=X+7. (which isn't printed out)<br /><br />Otherwise, I'm still missing the last trick?Everett F Sargenthttps://www.blogger.com/profile/00201577558036010680noreply@blogger.comtag:blogger.com,1999:blog-7612793.post-23799887579229822242018-04-15T20:32:38.285+00:002018-04-15T20:32:38.285+00:00EFS: nearly. You've missed the last trick thou...EFS: nearly. You've missed the last trick though.William M. Connolleyhttps://www.blogger.com/profile/05836299130680534926noreply@blogger.comtag:blogger.com,1999:blog-7612793.post-34500748448755922782018-04-13T03:49:41.016+00:002018-04-13T03:49:41.016+00:00It's Greek to me.
https://vvattsupwiththat.bl...<b><a href="https://vvattsupwiththat.blogspot.com/2016/01/the-climate-of-gods.html" rel="nofollow">It's Greek to me.</a></b><br /><br />https://vvattsupwiththat.blogspot.com/2016/01/the-climate-of-gods.htmlTHE CLIMATE WARShttps://www.blogger.com/profile/02578106673226403151noreply@blogger.comtag:blogger.com,1999:blog-7612793.post-65151327203829832042018-04-12T03:41:49.886+00:002018-04-12T03:41:49.886+00:00INVERSE is an integer by default, thus inverse=1/5...INVERSE is an integer by default, thus inverse=1/5=0 (default F77 is 6 characters, but doesn't matter here due to revisions to the FORTRAN standard). I normally follow the F&& standard except when I don't, which is often, thus all my codes are wrong but always give me my preferred answers.Everett F Sargenthttps://www.blogger.com/profile/00201577558036010680noreply@blogger.comtag:blogger.com,1999:blog-7612793.post-45301304982554356332018-04-12T03:32:03.647+00:002018-04-12T03:32:03.647+00:00Still messed it up (via online formatting, x=photo...Still messed it up (via online formatting, x=photo1*photo1=25,x=x+17=42), but I know the answer.Everett F Sargenthttps://www.blogger.com/profile/00201577558036010680noreply@blogger.comtag:blogger.com,1999:blog-7612793.post-20119033852443285582018-04-12T03:27:05.746+00:002018-04-12T03:27:05.746+00:00"GOTO!"
... should read ...
"GOT..."GOTO!"<br /><br />... should read ... <br /><br />"GOTO1" (I held down the shift key when typing "1")Everett F Sargenthttps://www.blogger.com/profile/00201577558036010680noreply@blogger.comtag:blogger.com,1999:blog-7612793.post-50247098798970458612018-04-12T03:24:40.250+00:002018-04-12T03:24:40.250+00:0042.
X = photo1 * pHOTO1 (basically the G in GOTO!...42.<br /><br />X = photo1 * pHOTO1 (basically the G in GOTO! is read as a continuation of the previous statement)<br />(G in GOTO! occupies the 6th character position which is the default position for a FORTRAN continuation statement)<br /><br /> X = photo1 * pH<br /> GOTO 1<br /><br /><br />X = 25.<br /><br />X = 25. + 17. = 42.<br /><br />The FORTRAN compiler ignores case/spaces everywhere (by default, if there are no 'normal' FORTRAN syntax errors), thus spaces or tabs upper/lower case are ignored and thus ...<br /> X = photo1 * pH<br /> GOTO 1<br />... is actually ... <br />X = P h O t O 1<br />x = photo1Everett F Sargenthttps://www.blogger.com/profile/00201577558036010680noreply@blogger.com