Skip to content

Instantly share code, notes, and snippets.

@akanehara
Created November 27, 2014 11:51
Show Gist options
  • Select an option

  • Save akanehara/3c3a8a0c7b3dda8b02f9 to your computer and use it in GitHub Desktop.

Select an option

Save akanehara/3c3a8a0c7b3dda8b02f9 to your computer and use it in GitHub Desktop.
#use "metro.ml"
(* グラフの中の節(駅)を表す型 *)
type eki_t = {
namae : string; (* 駅名(漢字) *)
saitan_kyori : float; (* 最短距離 *)
temae_list : string list; (* 手前の駅名(漢字)のリスト *)
}
let make_eki_list ekimei =
let {kanji = kanji_; kana = kana_; romaji = romaji_; shozoku = shozoku_} = ekimei in
{namae = kanji_; saitan_kyori = max_float; temae_list = []}
let rec map f xs =
match xs with
[] -> []
| (x :: xs) -> f x :: map f xs
let global_eki_t_list = map make_eki_list global_ekimei_list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment