That git is a real shot in the tucchus, isn't it? We'll play with that some more.
Today's big new things were functions and methods. A function is just a way to manipulate data. A method is a function that is attached to an object of some kind, like a number or a string or what have you. The data that gets manipulated by a function has to be given to it as one or more arguments. A method can have arguments as well, and it can access some of the data in its object as well.
Inside a function or method you can have other functions and methods, and data types. You can also have control structures, like if and else and while and until, and comparisons like <, >, or == (which is not the same as =), as well as logical operators like && and ||. That's about it.
For today's assignment, you will write a function that takes the English word for a number and turns it into an actual number. For example:
Your function should (a) have a better name than that, and (b) work for any integer up to at least 100. 1_000_000_000 would be better.
Start by writing expectations for some return values given some inputs. Then write out in English the rules for how numbers are named. Then translate your English into Ruby. Include some expectations in your file so you know it works. Save your work in a file called _some_expressivename.rb.
Objectives
Learning Objectives
After completing this assignment, you will have a better understanding of some aspects of git:
what branching represents
the relationship between a branch in git and a folder
what a remote is
what the arguments to git functions mean
You will also know a lot more about Ruby:
how to write a function or a method
including arguments
how to control flow
how to determine a return value
how to set precise expectations in English for your code
what it should return
what its internal logic should accomplish
Performance Objectives
After completing this assignment, you will be able to:
write and execute code that can solve interesting problems
use git to clone a repository, perform work in a branch, and merge your local changes into the original repository
Add your thoughts on today's assignment to the existing reflections page
Edit the lightbulbs and struggles pages
A branch in yourTIY-Assignments repo named feature/02--High-Functioning that contains:
a series of commits after each milestone or hour (whichever comes first), with an informative commit message for each
A folder called docs/ that contains:
data_types.md -- a Markdown file containing names, definitions, methods, and uses for each data type you've learned about so far
A folder called code/ that contains:
some_expressive_name.rb
A Pull Request (PR) in yourTIY-Assignments repo:
from the branch feature/02--High-Functioning (head)
into the master branch (base)
description that links to your WIP Issue in the class repo using Github Flavored Markdown
two :thumbsup: comments from peers who have reviewed your work
Comments on your WIP Issue for the following:
a link to your wiki (absolute URL)
a link to your PR using Github Flavored Markdown
Requirements
Tasks
[x] Estimate all the top-level tasks with T-shirt sizes: S, M, L, XL
[x] Work through some introductory lessons at Learn Git Branching (1-3 of the Introductory Sequence on the Main menu, and 1-4 of Push & Pull on the Remote menu). There's a lot of animated branching diagrams in that tutorial, so you'll have to concentrate on using them to help you learn instead of just looking at them. Like we do during lecture, try to imagine what will happen next for each step.
[x] End of lab wiki edit (please finish this by 5 so I can use the feedback in shaping plans for tomorrow)
[x] Add your thoughts on this assignment to the Assignment Evaluation page.
[x] Update Light Bulbs and Things I Don't Get Yet to reflect how you feel at the end of lab.
[x] End of day wiki edit (please do these as your final tasks)
[x] Add your thoughts on this assignment to the Assignment Evaluation page.
[x] Update Light Bulbs and Things I Don't Get Yet to reflect how you feel at the end of the day.
[x] Use the Terminal in your computer to:
[x] create a branch of yourTIY-Assignments repo called feature/02--high-functioning
[x] switch to the new branch
[x] Create at least one file and directory as described above in Deliverables.
[x] Add and commit your work every hour or at every breakthrough (whichever comes first)
[x] Push your commits to Github
[x] In Github, open a PR fromfeature/02--high-functioningintomaster
Notes
If you haven't completed all of the tasks from yesterday, do so.
02 -- High Functioning
Description
That git is a real shot in the tucchus, isn't it? We'll play with that some more.
Today's big new things were functions and methods. A function is just a way to manipulate data. A method is a function that is attached to an object of some kind, like a number or a string or what have you. The data that gets manipulated by a function has to be given to it as one or more arguments. A method can have arguments as well, and it can access some of the data in its object as well.
Inside a function or method you can have other functions and methods, and data types. You can also have control structures, like
if
andelse
andwhile
anduntil
, and comparisons like<
,>
, or==
(which is not the same as=
), as well as logical operators like&&
and||
. That's about it.For today's assignment, you will write a function that takes the English word for a number and turns it into an actual number. For example:
Your function should (a) have a better name than that, and (b) work for any integer up to at least 100. 1_000_000_000 would be better.
Start by writing expectations for some return values given some inputs. Then write out in English the rules for how numbers are named. Then translate your English into Ruby. Include some expectations in your file so you know it works. Save your work in a file called _some_expressivename.rb.
Objectives
Learning Objectives
After completing this assignment, you will have a better understanding of some aspects of
git
:git
and a folderYou will also know a lot more about Ruby:
Performance Objectives
After completing this assignment, you will be able to:
git
to clone a repository, perform work in a branch, and merge your local changes into the original repositoryDeliverables
"02 -- High Functioning -- #{YOUR NAME}"
with:TIY-Assignments
repo wiki:TIY-Assignments
repo namedfeature/02--High-Functioning
that contains:docs/
that contains:data_types.md
-- a Markdown file containing names, definitions, methods, and uses for each data type you've learned about so farcode/
that contains:some_expressive_name.rb
TIY-Assignments
repo:feature/02--High-Functioning
(head)master
branch (base)Requirements
Tasks
TIY-Assignments
repo calledfeature/02--high-functioning
feature/02--high-functioning
intomaster
Notes
If you haven't completed all of the tasks from yesterday, do so.