俳句ジェネレーター。1 音節と 2 音節の配列からランダムに取り出して、5-7-5 の音節に続く新しい俳句に入れるプログラム
Microsoft Small Basic を使用しています。
俳句ジェネレーター。1 音節と 2 音節の配列からランダムに取り出して、5-7-5 の音節に続く新しい俳句に入れるプログラム
Microsoft Small Basic を使用しています。
The idea behind the solution, i i may, is to make a 3 dimension array.
array["syllables"][1][1] = "red"
array["syllables"][1][2] = "Cat"
array["syllables"][1][3] = "The"
array["syllables"][2][1] = "reading"
and keep going with as many words as you like. then create 3 while loops the first, while the number of syllables in not greater than 5 keep adding words, using the 2nd array dimension as an adder. so get random number that is not greater than the number of syllables possible for the rule. Once you have a random word. add that syllable to a number holder and make the while loop number you are at < total syllables.
in the second not greater than 7 and 3rd not greater than 5.
Hope that helps.