Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 1.36 KB

task.md

File metadata and controls

50 lines (32 loc) · 1.36 KB

Writing a ruby program

Goals

  • write a ruby program
  • escape special characters
  • learn about "usage"
  • Use loops
  • Give your program arguments
  • Use ruby documentation

Tips

Steps

  1. Write a ruby program with exactly the following output (including separate lines and dots):

I want a dyke for president

...

I want a Black woman for president

I want someone with bad teeth...

Zoe Leonard

1992

  1. Put quotes around the poem:

"I want a dyke for president ... I want a Black woman for president I want someone with bad teeth..." Zoe Leonard 1992

  1. Write comments in the program to tell me what it does

  2. Allow the user to add a line to the poem after the first line. How would we do this? Using arguments

  3. Make it so that a user can write as many arguments as they want with each argument displaying as a line in the poem

  4. Add your authorship to the piece, e.g. "& Laura Wadden". Hint: make the author the first argument

  5. Tell the user how many lines they added, e.g., "Your new version of the poem added 3 lines"

  6. How can we improve our program? Could we name our variables smarter so people know what we are talking about? Could we extract variables where we write in explicit things?