LoginSignup
6
4

More than 5 years have passed since last update.

プログラミングとか良くわからない初心者なので、CMakeで書いてみました!

zd.cmake
set(kiyoshied false)
set(zun 0)

while(NOT kiyoshied)
    string(RANDOM LENGTH 1 ALPHABET 01 number)
    if(${number})
        message("ズン")
        math(EXPR zun "${zun}+1")
    else()
        message("ドコ")
        if(${zun} EQUAL 4)
            message("キ・ヨ・シ!")
            set(kiyoshied true)
        endif()
        set(zun 0)
    endif()
endwhile()
$ cmake -P zd.cmake
ズン
ドコ
ズン
ドコ
ドコ
ドコ
ドコ
ズン
ドコ
ドコ
ドコ
ズン
ズン
ズン
ズン
ドコ
キ・ヨ・シ!
6
4
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
6
4