LoginSignup
0
0

More than 5 years have passed since last update.

十字の壁がそそり立つ世界の中を君は螺旋状に歩く (規則性、AIR-lang)

Last updated at Posted at 2018-05-07
問題 http://nabetani.sakura.ne.jp/hena/ord28spirwa/
シミュレーション (Python/Ruby/C++) http://qiita.com/cielavenir/items/8c77a158136bd668a27b
規則性 (Python/Ruby/C/C#/Java) http://qiita.com/cielavenir/items/a285b0cea4a26ff886b8
規則性 (D/Go/Swift/PHP/ Vala ) http://qiita.com/cielavenir/items/edb1daff9ea861a418ec
規則性 (VB/F#/Perl) http://qiita.com/cielavenir/items/0c84af4049ab161f82c1
規則性 (PowerShell) http://qiita.com/cielavenir/items/d9ef9f12068e99e888f2
規則性 ( AIR-lang ) http://qiita.com/cielavenir/items/d804f61412fb4f07ba06
規則性 (Crystal/Perl6) http://qiita.com/cielavenir/items/13896a662b05da8b77a2
Rubyの多次元配列で最初の要素を加工して返したい
(tap/break等について)
http://qiita.com/cielavenir/items/3f209351b924e2615f5e

スクリプト言語AIRとして公開され、今はツインテールdeエンジェルモード!!と言う名前になっている謎言語。
このたびさくらサーバー上に導入したLinuxBrew上でビルドすることに成功しましたので、その記念にyhpgの過去問1つをば。

文法自体はかなりまともで、Perlに近いです。mapとかreverseとかないですが…

そういえば、flushしなくても正しく採点できるようです。どういう実装になってらっしゃるんだろう…

#!/usr/bin/env tt
# http://qiita.com/Nabetani/items/23ebddb44f0234e7fb15
# http://nabetani.sakura.ne.jp/hena/ord28spirwa/

dir="ESWN"
while(line=gets()){
    _=split(line,':')
    days=int(_[1])+1
    _=split(_[0],',')
    l={int(_[1]),int(_[2]),int(_[3]),int(_[0])}
    f=TRUE
    for(i=0;f;i++){
        x={l[i%4]+(i%4==0),(i/4*2)+2,l[i%4]-(i%4==3)}
        for(j=0;j<3;j++){
            if(days-x[j]<0){
                print("%c\n",subchr(dir,(i+j)%4))
                f=FALS
                break
            }
            days-=x[j]
        }
    }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0