-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatom.xml
More file actions
76 lines (60 loc) · 4.95 KB
/
Copy pathatom.xml
File metadata and controls
76 lines (60 loc) · 4.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Mark Greene</title>
<link href="http://mark-greene.github.io/atom.xml" rel="self"/>
<link href="http://mark-greene.github.io/"/>
<updated>2014-02-10T23:04:05-05:00</updated>
<id>http://mark-greene.github.io</id>
<author>
<name>Mark Greene</name>
</author>
<entry>
<title>Start of week two</title>
<link href="http://mark-greene.github.io/2014/02/10/start-of-week-two/"/>
<updated>2014-02-10T22:30:00Z</updated>
<id>http://mark-greene.github.io/2014/02/10/start-of-week-two</id>
<content type="html"><p>This week I'm working on my object oriented Blackjack game.
My procedural version was a good starting point, I just needed to encapsulate the behavior into classes.
I started with a Card class and a Deck class. I decided to go with a Hand class instead of seperate Player and Dealer classes.
My main game code went into a Blackjack class. I creaded test for each class to make sure the behavior is correct while I refactored the code.
I think the encapsulation works OK and my methods are farily small but there's always room for improvement.</p>
<p>The biggest problem I had/have is trying to use command line arguments with rspec. Seems like
OptionParser does not work well with rspec. I like the nested format option with rspec and had to add that to my code
to keep rspec happy. I'm hoping there is a better solution.</p>
<p>Let me know what you think. The code is in my Introduction to Ruby and Web Development Project under week-2 and
can be found <a href="http://github.com/mark-greene/intro-ruby-web/tree/master/week-2">here</a>.</p>
</content>
</entry>
<entry>
<title>Start of week one</title>
<link href="http://mark-greene.github.io/2014/02/03/start-of-week-one/"/>
<updated>2014-02-03T13:30:00Z</updated>
<id>http://mark-greene.github.io/2014/02/03/start-of-week-one</id>
<content type="html"><p>OK, things are a little better with the blog.
I think I have all links working and <a href="http://jekyllrb.com">jekyll</a> is a little more under control.
It was still way too much work :)</p>
<p>Now lets get to those week one challenges...</p>
</content>
</entry>
<entry>
<title>Welcome to my blog</title>
<link href="http://mark-greene.github.io/2014/02/01/welcome-to-my-blog/"/>
<updated>2014-02-01T09:30:00Z</updated>
<id>http://mark-greene.github.io/2014/02/01/welcome-to-my-blog</id>
<content type="html"><p>This is the first post to my <a href="http://www.gotealeaf.com" title="Introduction to Ruby and Web Development">Tealeaf Training</a> blog. I'm trying to use GitHub User Pages
and a <a href="http://jekyllrb.com">Jekyll template</a> for my blog. So far it's been way too much work. I think I should have
just used WordPress or Tumblr.</p>
<p>I thought markdown was all I would need to know but its lots of HTML/CSS and Javascript.
I'm just not a Web developer... yet.
Please excuse the broken links while I figure out what I'm doing.</p>
<h5>Playing around with Markdown</h5>
<div class="highlight"><pre><code class="ruby"><span class="k">def</span> <span class="nf">print_cards</span> <span class="n">cards</span>
<span class="nb">puts</span> <span class="s2">&quot;</span><span class="si">#{</span><span class="n">cards</span><span class="o">.</span><span class="n">count</span><span class="si">}</span><span class="s2">-card deck&quot;</span>
<span class="n">cards</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span> <span class="o">|</span> <span class="n">rank</span><span class="p">,</span> <span class="n">suit</span> <span class="o">|</span>
<span class="nb">puts</span> <span class="s2">&quot; </span><span class="si">#{</span><span class="n">rank</span><span class="si">}</span><span class="s2"> of </span><span class="si">#{</span><span class="n">suit</span><span class="si">}</span><span class="s2">&quot;</span>
<span class="k">end</span>
<span class="k">end</span>
</code></pre></div>
</content>
</entry>
</feed>