Skip to content

Write a command-line program that prints the number of lines spoken by each character in Shakespeare's play Macbeth.

Notifications You must be signed in to change notification settings

danygaytan/ruby-challenge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Analyzing Shakespeare

Difficulty: Easy

As a Shakespeare buff, statistics junkie, and Unix lover, Ben finds himself wanting a command-line tool for analyzing Macbeth.

Write a command-line program that prints the number of lines spoken by each character in Shakespear's play Macbeth.


Setup instructions

Fork and setup the exercise repository:

git clone <YOUR FORK ADDRESS>
cd analyzing-shakespeare
bin/setup

Exercise instructions

Sample usage/output (using made-up numbers):

$ ruby macbeth_analyzer.rb
  543 Macbeth
  345 Banquo
  220 Duncan
  (etc.)

You can find an XML-encoded version of Macbeth here: http://www.ibiblio.org/xml/examples/shakespeare/macbeth.xml. Your program should download and parse this file at runtime.

Note: some lines are attributed to a speaker called "ALL". Your program should ignore these.


Bonus

Your solution must be tested, preferably via TDD. Running your tests should not download the play from the ibiblio.org server.


Push your Solution

Once you're finished, commit your changes and then push your solution to your fork:

git push origin master

About

Write a command-line program that prints the number of lines spoken by each character in Shakespeare's play Macbeth.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 85.1%
  • Shell 14.9%