# ⑫チャレンジしよう！の解答例

    for i in 1...10 {
        if(top(i) == 1) { //赤の時
            color(1) //赤
            for j in 1...9 {
                drop(i)
            }
        }
        if(top(i) == 2) { //緑の時
            color(2)
            for j in 1...9 {
                drop(i)
            }
        }
        if(top(i) == 3) { //青の時
            color(3)
            for j in 1...9 {
                drop(i)
            }
        }
    }

戻る 次へ