LoginSignup
1
1

More than 5 years have passed since last update.

OCamlでも愛が生まれた

Last updated at Posted at 2016-05-09

OCamlでも愛が生まれた。UCoreLib依存。
もっと良い書き方を知りたい。

open UCoreLib;;

let love =
  let sei = UChar.int_of (Text.get (Text.of_string "生") 0) in
  let si = UChar.int_of (Text.get (Text.of_string "死") 0) in
  let ai = Text.to_string (Text.of_uchar (UChar.of_int (sei land si))) in
  ai  
;;

print_string love;;
1
1
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
1
1