<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>MikuHatsune</author_name>
  <author_url>https://blog.hatena.ne.jp/MikuHatsune/</author_url>
  <blog_title>驚異のアニヲタ社会復帰の予備</blog_title>
  <blog_url>https://mikuhatsune.hatenadiary.com/</blog_url>
  <categories>
    <anon>R</anon>
    <anon>数学</anon>
  </categories>
  <description>switchの使い方を教えてくれとNKが聞いてきたので書いてみる。 風邪気味だがしょうがない。だがしかし風邪であることをアピールしておけば女の子が家に来て看病してくれて熱い卵粥をフ〜フ〜して(ry NKはN QUEEN問題というものをやっているようだ。そのプログラムのなかのif分岐をswitchでスマートに書くよ。 for(d in 1:9) は、自分の位置（d=9）と自分の周囲（d=1:8）で条件分岐している。 これを正整数で書いているので switch(dir, # 入るのは正整数。 (i &lt;- i-1), # if(dir == 1 ){i &lt;- i-1} (i &lt;- i-1) &amp;&amp; (…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmikuhatsune.hatenadiary.com%2Fentry%2F20101219%2F1292739071&quot; title=&quot;switch関数 - 驚異のアニヲタ社会復帰の予備&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>2010-12-19 15:11:11</published>
  <title>switch関数</title>
  <type>rich</type>
  <url>https://mikuhatsune.hatenadiary.com/entry/20101219/1292739071</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
