joncodo / crib Goto Github PK
View Code? Open in Web Editor NEWA crib engine to play the card game crib with AI and a card counter
A crib engine to play the card game crib with AI and a card counter
Each suggestion is in a comment below...
This will allow you to use rake to automate testing and code coverage.
I suggesting adding a test and coverage task.
rake test # run all tests
rake coverage # generate a code coverage report using simplecov
Example Rakefile snippet:
desc 'Generate coverage report'
task :coverage do
ENV['COVERAGE'] = 'true'
system('rake test')
end
Individual recommendations in comments on this ticket.
I would get rid of the before(:each) block and just create the cards as needed. Because you're creating cards you aren't using in your tests.
I think describe Card, '#value'
can be describe '#value'
since it's already within the describe Card
block.
Change the spec-name 'is has the number value...' to 'is the rank value...'
Suggestions in comments...
Reason: to_s is ruby's idiomatic way of representing a class as a string.
Get rid of the display_value field, and add a to_s method that does the same thing.
def to_s
"#{number}-#{suit}"
end
Reason: these files have to do more with your programming environment than the problem domain.
Remove the .idea and .DS_Store files from source control, and add a .gitignore
file with the following entries
.idea
.DS_store
I'm experimenting with making each review point a separate comment...
I haven't played cribbage in a while, so take my comments lightly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.