Skip to content

Instantly share code, notes, and snippets.

@grapswiz
Created January 28, 2011 05:04
Show Gist options
  • Save grapswiz/799856 to your computer and use it in GitHub Desktop.
Save grapswiz/799856 to your computer and use it in GitHub Desktop.
(* x座標とy座標の組からx軸について対称な点の座標を返す *)
(* int * int -> int * int *)
let taisho_x pair = match pair with
(x, y) -> (x, -y)
let test1 = taisho_x (2, 1) = (2, -1)
let test2 = taisho_x (0, 5) = (0, -5)
let test3 = taisho_x (1, 0) = (1, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment