This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Card: | |
| """ Attributes and methods for the Card class """ | |
| suits = ["Clubs", "Diamonds", "Hearts", "Spades"] | |
| ranks = ["narf", "Ace", "2", "3", "4", "5", "6", "7", | |
| "8", "9", "10", "Jack", "Queen", "King"] | |
| def __init__(self, suit = 0, rank = 0): | |
| self.suit = suit | |
| self.rank = rank | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var ANCESTRY_FILE = "[\n " + [ | |
| '{"name": "Carolus Haverbeke", "sex": "m", "born": 1832, "died": 1905, "father": "Carel Haverbeke", "mother": "Maria van Brussel"}', | |
| '{"name": "Emma de Milliano", "sex": "f", "born": 1876, "died": 1956, "father": "Petrus de Milliano", "mother": "Sophia van Damme"}', | |
| '{"name": "Maria de Rycke", "sex": "f", "born": 1683, "died": 1724, "father": "Frederik de Rycke", "mother": "Laurentia van Vlaenderen"}', | |
| '{"name": "Jan van Brussel", "sex": "m", "born": 1714, "died": 1748, "father": "Jacobus van Brussel", "mother": "Joanna van Rooten"}', | |
| '{"name": "Philibert Haverbeke", "sex": "m", "born": 1907, "died": 1997, "father": "Emile Haverbeke", "mother": "Emma de Milliano"}', | |
| '{"name": "Jan Frans van Brussel", "sex": "m", "born": 1761, "died": 1833, "father": "Jacobus Bernardus van Brussel", "mother":null}', | |
| '{"name": "Pauwels van Haverbeke", "sex": "m", "born": 1535, "died": 1582, "father": "N. van Haverbeke", "mother":null}', | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def parse_sentence(word_list) | |
| puts "First state of the array" | |
| p word_list | |
| subj = parse_subject(word_list) | |
| puts "First shift getting the subject, if no subject, player goes default" | |
| p word_list | |
| verb = parse_verb(word_list) | |
| puts "Second shift getting the verb." | |
| p word_list | |
| obj = parse_object(word_list) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require_relative 'sentence.rb' | |
| #Check the type of the word and returns it. | |
| def peek(word_list) | |
| if word_list | |
| word = word_list[0] | |
| word[0] | |
| else | |
| nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rake/testtask' | |
| Rake::TestTask.new do |task| | |
| task.libs << "tests" | |
| task.test_files = FileList['tests/test*.rb'] | |
| task.verbose = true | |
| task.warning = true | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Loaded suite /home/jdecuirm/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/rake_test_loader | |
| Started | |
| .F | |
| =============================================================================== | |
| Failure: | |
| test_errors(TestName) | |
| /home/jdecuirm/Documents/Ruby_Development/RTHW/projects/ex48/tests/test_lexicon.rb:37:in `test_errors' | |
| 34: end | |
| 35: | |
| 36: def test_errors() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Started | |
| F | |
| =============================================================================== | |
| Failure: | |
| test_directions(TestName) | |
| /home/jdecuirm/Documents/Ruby_Development/RTHW/projects/ex48/tests/test_lexicon.rb:7:in `test_directions' | |
| 4: class TestName < Test::Unit::TestCase | |
| 5: | |
| 6: def test_directions() | |
| => 7: assert_equal(Lexicon.scan('north'),[['direction','north']]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rake/testtask' | |
| Rake::TestTask.new do |task| | |
| task.libs << "tests" | |
| task.test_files = FileList['tests/test*.rb'] | |
| task.verbose = true | |
| task.warning = true | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require './map.rb' | |
| require './engine.rb' | |
| require './scene.rb' | |
| require './hero.rb' | |
| puts "Hello, welcome to Medieval Kingdom!, first we have to create your character." | |
| puts "Please tell me your name: " | |
| print "> " | |
| hero_name = $stdin.gets.chomp | |
| hero = Hero.new(hero_name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require './scene.rb' | |
| class CentralCorridor < Scene | |
| def enter() | |
| puts "The Gothons of Planet Percal #25 have invaded your ship and destroyed" | |
| puts "your entire crew. You are the last surviving member and your last" | |
| puts "mission is to get the neutron destruct bomb from the Weapons Armory," | |
| puts "put it in the bridge, and blow the ship up after getting into an " | |
| puts "escape pod." |
NewerOlder