rubynovice 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/doc/file.ex1.html ADDED
@@ -0,0 +1,100 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
+ <title>
7
+ File: ex1
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '';
20
+ framesUrl = "frames.html#!file.ex1.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index</a> &raquo;
35
+ <span class="title">File: ex1</span>
36
+
37
+
38
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
39
+ </div>
40
+
41
+ <div id="search">
42
+
43
+ <a class="full_list_link" id="class_list_link"
44
+ href="class_list.html">
45
+ Class List
46
+ </a>
47
+
48
+ <a class="full_list_link" id="method_list_link"
49
+ href="method_list.html">
50
+ Method List
51
+ </a>
52
+
53
+ <a class="full_list_link" id="file_list_link"
54
+ href="file_list.html">
55
+ File List
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <iframe id="search_frame"></iframe>
63
+
64
+ <div id="content"><div id='filecontents'><h1>Ex1. 代入および出力</h1>
65
+
66
+ <h2>Ex1_1:hello worldを返せ.</h2>
67
+
68
+ <pre class="code terminal"><code class="terminal">[bobsNewMacBook:~/Desktop/Ruby/ThreeDays] bob% ruby ex0.rb
69
+ Hello world!
70
+ [bobsNewMacBook:~/Desktop/Ruby/ThreeDays] bob% cat ex0.rb
71
+ puts &quot;Hello world!&quot;
72
+ </code></pre>
73
+
74
+ <h2>Ex1_2:変数への代入とreturn</h2>
75
+
76
+ <p>1+1をaに代入して,その値を返す関数を作れ.</p>
77
+
78
+ <pre class="code ruby"><code class="ruby">[bobsNewMacBook:~/Desktop/Ruby/ThreeDays] bob% ruby ex2.rb
79
+ 2
80
+ [bobsNewMacBook:~/Desktop/Ruby/ThreeDays] bob% cat ex1.rb
81
+ a=1+1
82
+ return a
83
+ </code></pre>
84
+
85
+ <h2>Ex1_3:printf</h2>
86
+
87
+ <p>printfで&quot;ans=2\n&quot;と返す関数を作れ.</p>
88
+
89
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_expected'>expected</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>ans=2\n</span><span class='tstring_end'>&quot;</span></span>
90
+ </code></pre>
91
+ </div></div>
92
+
93
+ <div id="footer">
94
+ Generated on Tue May 17 20:56:13 2016 by
95
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
96
+ 0.8.7.6 (ruby-2.2.2).
97
+ </div>
98
+
99
+ </body>
100
+ </html>
data/doc/file.ex2.html ADDED
@@ -0,0 +1,147 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
+ <title>
7
+ File: ex2
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '';
20
+ framesUrl = "frames.html#!file.ex2.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index</a> &raquo;
35
+ <span class="title">File: ex2</span>
36
+
37
+
38
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
39
+ </div>
40
+
41
+ <div id="search">
42
+
43
+ <a class="full_list_link" id="class_list_link"
44
+ href="class_list.html">
45
+ Class List
46
+ </a>
47
+
48
+ <a class="full_list_link" id="method_list_link"
49
+ href="method_list.html">
50
+ Method List
51
+ </a>
52
+
53
+ <a class="full_list_link" id="file_list_link"
54
+ href="file_list.html">
55
+ File List
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <iframe id="search_frame"></iframe>
63
+
64
+ <div id="content"><div id='filecontents'><h1>Ex2. Loop</h1>
65
+
66
+ <h2>Ex2_2:times</h2>
67
+
68
+ <p>百回愛してると表示する.</p>
69
+
70
+ <pre class="code ruby"><code class="ruby"><span class='int'>100</span><span class='period'>.</span><span class='id identifier rubyid_times'>times</span> <span class='kw'>do</span>
71
+ <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>I love Haruyo.</span><span class='tstring_end'>&quot;</span></span>
72
+ <span class='kw'>end</span>
73
+ </code></pre>
74
+
75
+ <h2>Ex2_3:for-loop</h2>
76
+
77
+ <pre class="code tcsh"><code class="tcsh">1
78
+ 2
79
+ 3
80
+ 4
81
+ 5
82
+ </code></pre>
83
+
84
+ <pre class="code tcsh"><code class="tcsh">for i in 1..5 do
85
+ puts i
86
+ end
87
+ </code></pre>
88
+
89
+ <h2>Ex2_4:while</h2>
90
+
91
+ <pre class="code ruby"><code class="ruby"><span class='kw'>while</span> <span class='id identifier rubyid_条件文'>条件文</span> <span class='kw'>do</span>
92
+ <span class='id identifier rubyid_繰り返し'>繰り返し</span>
93
+ <span class='kw'>end</span>
94
+ </code></pre>
95
+
96
+ <pre class="code ruby"><code class="ruby"><span class='int'>10</span>
97
+ <span class='int'>8</span>
98
+ <span class='int'>6</span>
99
+ <span class='int'>4</span>
100
+ <span class='int'>2</span>
101
+ </code></pre>
102
+
103
+ <h2>Ex2_5:二重ループ(printを使って..)(doubleLoop)</h2>
104
+
105
+ <pre class="code ruby"><code class="ruby">1,1
106
+ 1,2
107
+ 1,3
108
+ 2,1
109
+ 2,2
110
+ 2,3
111
+ 3,1
112
+ 3,2
113
+ 3,3
114
+ </code></pre>
115
+
116
+ <h2>Ex2_6:九九表(printfを使って)(9x9)</h2>
117
+
118
+ <pre class="code ruby"><code class="ruby"> 1 2 3 4 5 6 7 8 9
119
+ 2 4 6 8 10 12 14 16 18
120
+ 3 6 9 12 15 18 21 24 27
121
+ 4 8 12 16 20 24 28 32 36
122
+ 5 10 15 20 25 30 35 40 45
123
+ 6 12 18 24 30 36 42 48 54
124
+ 7 14 21 28 35 42 49 56 63
125
+ 8 16 24 32 40 48 56 64 72
126
+ 9 18 27 36 45 54 63 72 81
127
+ </code></pre>
128
+
129
+ <h2>Ex2_6:1から10までの和(sum)</h2>
130
+
131
+ <pre class="code ruby"><code class="ruby"><span class='int'>55</span>
132
+ </code></pre>
133
+
134
+ <h2>Ex2_7:10!(10*9*8..3*2*1) (factorial)</h2>
135
+
136
+ <pre class="code ruby"><code class="ruby"><span class='int'>3628800</span>
137
+ </code></pre>
138
+ </div></div>
139
+
140
+ <div id="footer">
141
+ Generated on Tue May 17 20:56:13 2016 by
142
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
143
+ 0.8.7.6 (ruby-2.2.2).
144
+ </div>
145
+
146
+ </body>
147
+ </html>
data/doc/file.ex3.html ADDED
@@ -0,0 +1,139 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
+ <title>
7
+ File: ex3
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '';
20
+ framesUrl = "frames.html#!file.ex3.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index</a> &raquo;
35
+ <span class="title">File: ex3</span>
36
+
37
+
38
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
39
+ </div>
40
+
41
+ <div id="search">
42
+
43
+ <a class="full_list_link" id="class_list_link"
44
+ href="class_list.html">
45
+ Class List
46
+ </a>
47
+
48
+ <a class="full_list_link" id="method_list_link"
49
+ href="method_list.html">
50
+ Method List
51
+ </a>
52
+
53
+ <a class="full_list_link" id="file_list_link"
54
+ href="file_list.html">
55
+ File List
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <iframe id="search_frame"></iframe>
63
+
64
+ <div id="content"><div id='filecontents'><h1>Ex3. 配列</h1>
65
+
66
+ <h2>Ex3_1:配列(list)</h2>
67
+
68
+ <pre class="code tcsh"><code class="tcsh">5
69
+ 4
70
+ 3
71
+ 2
72
+ 1
73
+ </code></pre>
74
+
75
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_a'>a</span><span class='op'>=</span><span class='lbracket'>[</span><span class='int'>5</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='comma'>,</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='rbracket'>]</span>
76
+ <span class='kw'>for</span> <span class='id identifier rubyid_i'>i</span> <span class='kw'>in</span> <span class='int'>0</span><span class='op'>..</span><span class='int'>4</span> <span class='kw'>do</span>
77
+ <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_a'>a</span><span class='lbracket'>[</span><span class='id identifier rubyid_i'>i</span><span class='rbracket'>]</span>
78
+ <span class='kw'>end</span>
79
+ </code></pre>
80
+
81
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_a'>a</span><span class='op'>=</span><span class='lbracket'>[</span><span class='int'>5</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>3</span><span class='comma'>,</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>1</span><span class='rbracket'>]</span>
82
+ <span class='id identifier rubyid_a'>a</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_tmp'>tmp</span><span class='op'>|</span>
83
+ <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_tmp'>tmp</span>
84
+ <span class='kw'>end</span>
85
+ </code></pre>
86
+
87
+ <h2>Ex3_2:1から100までの乱数を10個格納した配列を作れ.(rand)</h2>
88
+
89
+ <pre class="code tcsh"><code class="tcsh">[9, 13, 5, 51, 15, 51, 5, 99, 77, 88]
90
+ </code></pre>
91
+
92
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_a'>a</span><span class='op'>=</span><span class='lbracket'>[</span><span class='rbracket'>]</span>
93
+ <span class='int'>10</span><span class='period'>.</span><span class='id identifier rubyid_times'>times</span> <span class='kw'>do</span>
94
+ <span class='id identifier rubyid_tmp'>tmp</span><span class='op'>=</span><span class='id identifier rubyid_rand'>rand</span><span class='lparen'>(</span><span class='int'>100</span><span class='rparen'>)</span><span class='op'>+</span><span class='int'>1</span>
95
+ <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_tmp'>tmp</span>
96
+ <span class='id identifier rubyid_a'>a</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_tmp'>tmp</span>
97
+ <span class='kw'>end</span>
98
+ <span class='id identifier rubyid_p'>p</span> <span class='id identifier rubyid_a'>a</span>
99
+ </code></pre>
100
+
101
+ <h2>Ex3_3:さいころを100回振って,1から6の目が何回出たかを表示せよ(dice)</h2>
102
+
103
+ <pre class="code tcsh"><code class="tcsh">[0, 21, 15, 17, 15, 13, 19]
104
+ </code></pre>
105
+
106
+ <h2>Ex3_4:rand()で生成される小数の10桁目までを配列に蓄えよ.(rand2list)</h2>
107
+
108
+ <pre class="code tcsh"><code class="tcsh">0.975006684566814
109
+ [9, 7, 5, 0, 0, 6, 6, 8, 4, 5]
110
+ </code></pre>
111
+
112
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_a'>a</span><span class='op'>=</span><span class='id identifier rubyid_rand'>rand</span><span class='lparen'>(</span><span class='rparen'>)</span>
113
+ <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_a'>a</span>
114
+ <span class='id identifier rubyid_num'>num</span><span class='op'>=</span><span class='lbracket'>[</span><span class='rbracket'>]</span>
115
+ <span class='int'>10</span><span class='period'>.</span><span class='id identifier rubyid_times'>times</span> <span class='kw'>do</span>
116
+ <span class='id identifier rubyid_b'>b</span><span class='op'>=</span><span class='lparen'>(</span><span class='id identifier rubyid_a'>a</span><span class='op'>*</span><span class='int'>10</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
117
+ <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_b'>b</span>
118
+ <span class='id identifier rubyid_a'>a</span><span class='op'>=</span><span class='id identifier rubyid_a'>a</span><span class='op'>*</span><span class='int'>10</span><span class='op'>-</span><span class='id identifier rubyid_b'>b</span>
119
+ <span class='id identifier rubyid_num'>num</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_b'>b</span>
120
+ <span class='kw'>end</span>
121
+ <span class='id identifier rubyid_p'>p</span> <span class='id identifier rubyid_num'>num</span>
122
+ </code></pre>
123
+
124
+ <h2>Ex3_5前問で求めた配列から10桁の整数を作れ.(list2int)</h2>
125
+
126
+ <pre class="code tcsh"><code class="tcsh">0.258949661837373
127
+ [2, 5, 8, 9, 4, 9, 6, 6, 1, 8]
128
+ 2589496618
129
+ </code></pre>
130
+ </div></div>
131
+
132
+ <div id="footer">
133
+ Generated on Tue May 17 20:56:13 2016 by
134
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
135
+ 0.8.7.6 (ruby-2.2.2).
136
+ </div>
137
+
138
+ </body>
139
+ </html>
@@ -0,0 +1,75 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html>
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+
7
+ <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
8
+
9
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
10
+
11
+
12
+
13
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
14
+
15
+ <script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
16
+
17
+
18
+ <title>File List</title>
19
+ <base id="base_target" target="_parent" />
20
+ </head>
21
+ <body>
22
+ <script type="text/javascript" charset="utf-8">
23
+ var hasFrames = false;
24
+ try {
25
+ hasFrames = window.top.frames.main ? true : false;
26
+ } catch (e) { }
27
+ if (hasFrames) {
28
+ document.getElementById('base_target').target = 'main';
29
+ document.body.className = 'frames';
30
+ }
31
+ </script>
32
+ <div id="content">
33
+ <h1 id="full_list_header">File List</h1>
34
+ <div id="nav">
35
+
36
+ <span><a target="_self" href="class_list.html">
37
+ Classes
38
+ </a></span>
39
+
40
+ <span><a target="_self" href="method_list.html">
41
+ Methods
42
+ </a></span>
43
+
44
+ <span><a target="_self" href="file_list.html">
45
+ Files
46
+ </a></span>
47
+
48
+ </div>
49
+ <div id="search">Search: <input type="text" /></div>
50
+
51
+ <ul id="full_list" class="file">
52
+
53
+
54
+ <li class="r1"><span class="object_link"><a href="index.html" title="README">README</a></a></li>
55
+
56
+
57
+ <li class="r2"><span class="object_link"><a href="file.ex1.html" title="ex1">ex1</a></a></li>
58
+
59
+
60
+ <li class="r1"><span class="object_link"><a href="file.ex2.html" title="ex2">ex2</a></a></li>
61
+
62
+
63
+ <li class="r2"><span class="object_link"><a href="file.ex3.html" title="ex3">ex3</a></a></li>
64
+
65
+
66
+ <li class="r1"><span class="object_link"><a href="file.README_en.html" title="README_en">README_en</a></a></li>
67
+
68
+
69
+ <li class="r2"><span class="object_link"><a href="file.README_ja.html" title="README_ja">README_ja</a></a></li>
70
+
71
+
72
+ </ul>
73
+ </div>
74
+ </body>
75
+ </html>