Skip to content

Instantly share code, notes, and snippets.

@fetburner
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save fetburner/65a362e5a835cc00f7e2 to your computer and use it in GitHub Desktop.

Select an option

Save fetburner/65a362e5a835cc00f7e2 to your computer and use it in GitHub Desktop.
桜Trick
let trick = ['T'; 'r'; 'i'; 'c'; 'k']
let n = List.length trick
let title =
[("桜色のはじまり", "やきそばとベランダと女の子");
("もうひとつの桜色", "放課後はハリーちゃんと♥");
("会長はお姉ちゃん", "プール掃除でお約束");
("すっぱい大作戦?", "もしかして肝試し!?");
("お姉ちゃんとお茶しよう!", "魔女とリンゴとお姉ちゃんと");
("文化祭だよ☆お泊まりです♥", "文化祭だよ☆本番です!");
("水着でサービス☆ポロリもあるよ♥", "優ちゃんとお買い物♥");
("桜色のウエディング", "桜色なクリスマス");
("年末デビューのS・B・J・K", "続・すっぱい大作戦!?");
("雪の日と思い出と衝撃", "体育倉庫でお約束");
("会長はスミスミなのじゃ!", "桜色の真実");
("プリンと美月の決意", "桜Trick")]
let cour = List.length title
let repeat f =
let rec repeat_aux acc = function
| 0 -> List.rev acc
| n -> repeat_aux (f () :: acc) (n - 1) in
repeat_aux []
let rec sakuratrick m =
let trip_trouble = repeat (fun () ->
List.nth trick @@ Random.int n) n in
print_string "桜";
List.iter print_char trip_trouble;
if trip_trouble = trick then
(print_endline "\n\nKiss!Kiss!Kiss!もう夢中なの\n";
Printf.printf "Trick%d\n" m;
let (a, b) = List.nth title (m mod cour) in
Printf.printf "A「%s」\n" a;
Printf.printf "B「%s」\n" b)
else
sakuratrick (m + 1)
let () =
Random.self_init ();
sakuratrick 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment