Git Product home page Git Product logo

ttt-1-welcome-rb-v-000's Introduction

Welcome Message for Tic Tac Toe

Overview

We're going to build a simple program that implements only the very first thing a complete Tic Tac Toe program would require, which is to greet the player with a welcome message.

Objectives

  1. Read the output from running learn.
  2. Use puts to print "Welcome to Tic Tac Toe!"
  3. Have tests pass locally by running learn.
  4. Submit solution.

Instructions

  1. Run learn
  2. Read output.
  3. Code solution in lib/welcome.rb
  4. Run learn
  5. Read output.
  6. If still broken, repeat 3-5
  7. If passing, submit with learn submit

Troubleshooting

Here are some things you can try to get more clues to solve the lab.

1. Try running ruby lib/welcome.rb

When you run ruby lib/welcome.rb from your terminal you are asking the Ruby interpreter to run your program. If you see no output, like below, that means there is no code in lib/welcome.rb to print "Welcome to Tic Tac Toe!".

Note: The file welcome.rb already exists in the folder lib, but is not displayed in Learn IDE default view.

No Puts

The solution to this is to make sure you have puts "Welcome to Tic Tac Toe!" in lib/welcome.rb. A working program should look like:

Working program

Note: Contrary to the workflow of the previous lesson, it is NOT necessary to create a new file to contain the 'puts` instruction.

Hint: Make sure you've saved lib/welcome.rb.

2. Make sure you're printing "Welcome to Tic Tac Toe!" exactly.

When you run learn you might see failing tests even though your program seemingly works. The failures might read something like:

1) lib/welcome.rb prints "Welcome to Tic Tac Toe!"
   Failure/Error: load './lib/welcome.rb'
     #<IO:0x007fa2b28325a0> received :puts with unexpected arguments
       expected: ("Welcome to Tic Tac Toe!")
            got: ("Welcome to Tic Tac Toe")
   # ./lib/welcome.rb:4:in `puts'

An error like this is telling you that the test expects you to print "Welcome to Tic Tac Toe!", but you printed something else. Programming is absolutely precise, make sure your tests are printing exactly "Welcome to Tic Tac Toe!".

View Welcome Message for Tic Tac Toe on Learn.co and start learning to code for free.

ttt-1-welcome-rb-v-000's People

Contributors

aviflombaum avatar annjohn avatar drakeltheryuujin avatar maxwellbenton avatar rambllah avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.