<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>obelisk2</author_name>
  <author_url>https://blog.hatena.ne.jp/obelisk2/</author_url>
  <blog_title>Camera Obscura</blog_title>
  <blog_url>https://obelisk.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>数学</anon>
    <anon>アルゴリズム</anon>
  </categories>
  <description>ゆえあって n進グレイコードへの変換式を作ることになった。 グレイコード - Wikipedia グレイコードについてはここにあるとおりである。2進グレイコードなら、ネットを検索すればたくさん出てくる。具体例は、Ruby のハッシュで表すとこんな感じだ。 {&quot;0&quot;=&gt;&quot;000&quot;, &quot;1&quot;=&gt;&quot;001&quot;, &quot;10&quot;=&gt;&quot;011&quot;, &quot;11&quot;=&gt;&quot;010&quot;, &quot;100&quot;=&gt;&quot;110&quot;, &quot;101&quot;=&gt;&quot;111&quot;, &quot;110&quot;=&gt;&quot;101&quot;, &quot;111&quot;=&gt;&quot;100&quot;}キーが 2進数、値が 2進グレイコードである。10進数の 3 から 4 は 2進数だと 011 から 100 で、3つのビットが変化…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fobelisk.hatenablog.com%2Fentry%2F2018%2F01%2F30%2F104019&quot; title=&quot;n進グレイコード（Ruby） - Camera Obscura&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-01-30 10:40:19</published>
  <title>n進グレイコード（Ruby）</title>
  <type>rich</type>
  <url>https://obelisk.hatenablog.com/entry/2018/01/30/104019</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
