fortran66のブログ

fortran について書きます。

ハノイの塔

[Fortran95]なんとなくハノイの塔

実行結果 N=4

 move a to c
 move a to b
 move c to b
 move a to c
 move b to a
 move b to c
 move a to c
 move a to b
 move c to b
 move c to a
 move b to a
 move c to b
 move a to c
 move a to b
 move c to b
続行するには何かキーを押してください . . .

ソースコード

    program tower_of_hanoi
      implicit none
      call hanoi(4, 'a', 'b', 'c')
      stop
    contains
      recursive subroutine hanoi(n, a, b, c)
        integer, intent(in) :: n
        character(len = *), intent(in) :: a, b, c
        if (n == 0) return
        call hanoi(n - 1, a, c, b)
        write(*, *) 'move ', a, ' to ', b
        call hanoi(n - 1, c, b, a)
        return
      end subroutine hanoi  
    end program tower_of_hanoi

中年バッカスのご尊顔

http://oggling.tumblr.com/image/41538321457

f:id:fortran66:20130126131653j:plain

TumblrFortran OOP講座が開かれている!

http://www.tumblr.com/tagged/fortran%E3%81%A7%E3%82%AA%E3%83%96%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E6%8C%87%E5%90%91%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0

The Economist にシータでバルス!

http://www.economist.com/blogs/economist-explains/2013/08/economist-explains-14

f:id:fortran66:20130822021150j:plain

日本に関する糞記事を垂れ流す英エコノミスト誌が珍しくましな記事。 しかしネタバレ回避のため『バルス』に言及せずw

ACM SIGPLAN Fortran Forum 8月号

http://dl.acm.org/citation.cfm?id=2502932&picked=prox&cfid=240351065&cftoken=33571807

Arjen Markus が alternative return で try..catch もどきの例外処理について書いている。しかし alternative return は規格から削除決定済み。

amazonAA

CoArrays: Parallel Programming in Fortran (Chapman & Hall/CRC Computational Science)発売さらに延期!

http://www.crcpress.com/product/isbn/9781439840047

確か2011年に出版予定だったものが2012年夏に延期され2013年夏に再延期され、さらに2014年5月へ延期!