Giter Site home page Giter Site logo

chattbot's Introduction

Chattbot, Week 1

This is a several-week curriculum for teaching Elixir to new students. This is week 1. Subsequent weeks will be added as branches.

Goals for Week 1:

  • Learn that Elixir code is primarily modules with functions inside
  • Those functions can be tested with software tests.

Vocabulary

Sometimes, it helps working through a couple of concepts in the console before you start. This is espeically true of new programmers. Here are the functions we need:

Pipes.

  • A pipe expression makes an expression from a piece of data, a pipe operator, and a function.
  • The data becomes the first argument in the function.
  • Pipes get more interesting as you string them together. They are like factories, transforming one thing into the next.

String functions

  • String.trim(string) creates a new string without the whitespace at the beginning and end of the string.
  • String.ends_with?(string, ending) returns true if string ends with ending. The question mark means the function will return a true or false. It's not something Elixir requires. It's something we do make it easier on folks reading this function.
  • a == b returns true if a and b are the same; false otherwise
  • a = b is a match. If a is not set, it makes a the same as b.
  • String.upcase(string) makes a new string with all letters converted to their capital form.
  • String.downcase(string) creates a new lower case version of string.

Installation

  1. Clone this repository.
  2. Delete the code in lib/sentence.ex.
  3. Make the tests pass, one by one.

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.