To get started with Rails we need to install the gem. From the terminal type:
{% terminal %}
$ gem install rails
Fetching: i18n-0.6.1.gem (100%)
Fetching: multi_json-1.3.6.gem (100%)
Fetching: activesupport-3.2.8.gem (100%)
...
{% endterminal %}
require 'ruby-processing' | |
class Board | |
def positions | |
@positions ||= [ [], [], [] ] | |
end | |
def at(x,y) | |
positions[x][y] |
To get started with Rails we need to install the gem. From the terminal type:
{% terminal %}
$ gem install rails
Fetching: i18n-0.6.1.gem (100%)
Fetching: multi_json-1.3.6.gem (100%)
Fetching: activesupport-3.2.8.gem (100%)
...
{% endterminal %}
Kata: Minesweeper 47
Have you ever played Minesweeper? It’s a cute little game which comes within a certain Operating System whose name we can’t really remember. Well, the goal of the game is to find all the mines within an MxN field. To help you, the game shows a number in a square which tells you how many mines there are adjacent to that square. For instance, take the following 4x4 field with 2 mines (which are represented by an * character):
*...
....
.*..
....
require 'happymapper' | |
class Branch | |
include HappyMapper | |
attr_accessor :tree | |
end | |
class Tree | |
include HappyMapper |
project = Xcode.project 'TestProject' | |
project.create_target 'Library', :bundle do |target| | |
target.create_build_phase :sources do |source| | |
source.add_build_file project.file('TestProject/AppDelegate.m') | |
end | |
target.create_build_phase :copy_headers do |headers| | |
headers.add_build_file_with_public_privacy project.file('TestProject/AppDelegate.h') |
I wanted to use a background gradient to represent the types of a Pokémon. There are 18 possible Pokémon types. Pokémon can have one type and some have two types. This leads to roughly 324 combinations (When a Pokémon is one type I simply double that type) or 171 combinations (18 as a triangular number) if I order the types.
Static Image: Pokemon Types Live: http://attackdex.herokuapp.com/
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class CursorScript : MonoBehaviour { | |
public Texture2D iconArrow; | |
public Vector2 arrowRegPoint; | |
public Texture2D iconZoom; |
I will write a small passage about a subject written in my language. I will share it with you. We will both translate the passage into your language.
We will share our translated passages. We will talk about corrections, make clarifications, and discuss language concepts.
I will create and share an audio recording of the passage I wrote. You will create and share an audio recording of the translated passage.
describe String do | |
it "responds to #to_s" do | |
expect("").to respond_to(:to_s) | |
end | |
it "responds to the correct methods" do | |
[ :to_s, :to_i, :to_f ].each do |method| | |
expect("").to respond_to(method) | |
end |