GithubHelp home page GithubHelp logo

ttt-1-welcome-rb's Introduction

Welcome Message for Tic Tac Toe

Learning Goals

  • Write a Ruby program.

Introduction

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.

Instructions

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

Troubleshooting

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

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.

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

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

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

When you run the tests 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!".

ttt-1-welcome-rb's People

Contributors

annjohn avatar aviflombaum avatar drakeltheryuujin avatar lizbur10 avatar maxwellbenton avatar rambllah avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ttt-1-welcome-rb's Issues

IDE not connecting

When I first downloaded IDE on my desktop, it worked completely fine. Then all of a sudden, it just disconnected and came up with this message:

Learn IDE: you are not connected!
The connection with the remote server failed.

It has not let me reconnect since.

Strangely, this issue only occurs on my desktop, and I have got it working on my laptop.

Need Help!!

There are no files to edit in atom to edit and proceed further in lesson

Not clear

Instructions are not clear in this program. I tried running learn and then ran a puts for the opening message but I think it is missing an irb statement.

Please correct README as follows

The instructions for this lesson are unclear and should be updated as follows:

  1. Contrary to the workflow of the previous lesson, it is NOT necessary to create a new file to contain the 'puts` instruction.
  2. The file welcome.rb already exists in the folder `lib' but is not displayed in Learn IDE default view.

Readme.md: redundant example code when expected 2 different examples

Referring to file:
learn-co-curriculum/ttt-1-welcome-rb-v-000/readme.md

Text needing correction from this file is pasted below the **** line.
The lecture leads reader to expect 2 different examples of error code but the same example shows up twice. I'm not going to suggest a specific edit. I can rerun the lab and produce different error output but some errors I produced might be confusing for some students at this early stage of the course (and I'm a newbie too!). So, it would be great if an instructor or more experienced coder produces new example error code to for 2 distinct examples in the readme file.
:-)


  1. 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'

Or something that looks 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'

Local Test not running

I have completed this lab but the local test are not updating the learn.co website to show no errors. It did update for "Learn Submit",

`[01:07:45] (master) ttt-1-welcome-rb-v-000
// ♥ ruby lib/welcome.rb
Welcome to Tic Tac Toe!
[01:08:46] (master) ttt-1-welcome-rb-v-000
// ♥ learn

lib/welcome.rb
prints "Welcome to Tic Tac Toe!"

Finished in 0.00732 seconds (files took 0.28743
seconds to load) `

2017-03-28_2117

Better introduction of TicTacToe

Given that building TicTacToe is going to be so central to this whole track, I feel like we should do a better job of teeing that up. Right now it feels almost like a non-sequitur.

Either with a readme that is dedicated to just introducing that, or a richer introduction that provides more introductory flavor along the lines of:

"One of the things that's most fun about programming is building applications that you can interact with. It's so satisfying to see your code in action!

Throughout this whole track we'll work together on building your very first app: An interact Tic Tac Toe game. In this lab, we'll get started on laying the foundation for the app. "

etc etc

Typo in spec file

Change it prints "Welcome to Tic Tac Toe" do to it prints "Welcome to Tic Tac Toe!" do in /spec/welcome_spec.rb

SSH

Getting an error message that Nitrous cannot be opened when I click on the open in Nitrous tab. The error messages asks if I've saved the SSH key. Help please. Thanks!

Error Message

Could not find proper version of rspec-core (3.3.2) in any of the sources
Run bundle install to install missing gems.

I received this issue when running the "learn" command.

Fixing Errors Lab in Ruby

I can't identify the problem & to fix it. It seems like the only error I was able to fix was in the lib file.

/ becomes : in Atom

Hi, I'm encountering a problem with Atom. When I save a new file as "lib/welcome.rb" it changes to "lib:welcome.rb" in treeview and command. When I run my program as such it works, but fails the test. I'm not sure what to do but i've been stuck here since yesterday. Please help. Thanks!

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.