diff --git a/README.md b/README.md index 31410dcb9b..103cea1ab9 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Exercism Exercises in Ruby -#### Table of Contents +## Table of Contents - [Setup](#setup) - [Anatomy of an Exercise](#anatomy-of-an-exercise) - [Canonical Data](#canonical-data) diff --git a/concepts/floating-point-numbers/about.md b/concepts/floating-point-numbers/about.md index 954eb71ad7..1a8b9d0a61 100644 --- a/concepts/floating-point-numbers/about.md +++ b/concepts/floating-point-numbers/about.md @@ -10,7 +10,7 @@ To repeatedly execute logic, one can use loops. In this example the `while` loop The `#years_before_desired_balance` method from the previous exercise could have been written by using any of the three mentioned loops: -### `while` +## `while` ```ruby def self.years_before_desired_balance(current_balance, desired_balance) @@ -23,7 +23,7 @@ def self.years_before_desired_balance(current_balance, desired_balance) end ``` -### `until` +## `until` ```ruby def self.years_before_desired_balance(current_balance, desired_balance) @@ -36,7 +36,7 @@ def self.years_before_desired_balance(current_balance, desired_balance) end ``` -### `loop` +## `loop` ```ruby def self.years_before_desired_balance(current_balance, desired_balance) diff --git a/docs/RESOURCES.md b/docs/RESOURCES.md index c3203b33e3..3610e39e52 100644 --- a/docs/RESOURCES.md +++ b/docs/RESOURCES.md @@ -1,13 +1,13 @@ # Recommended Resources -### Environment +## Environment * [Ruby](https://www.ruby-lang.org/) * [Ruby Gems](https://rubygems.org/) * [Bundler](http://bundler.io/) * [RVM](https://rvm.io/) * [rbenv](https://github.com/rbenv/rbenv) -### Docs +## Docs * [Ruby Doc](http://ruby-doc.org/) * [API Dock](http://apidock.com/) * [Minitest](http://docs.seattlerb.org/minitest/) diff --git a/exercises/concept/bird-count/.docs/hints.md b/exercises/concept/bird-count/.docs/hints.md index a36775b331..d9814f7f42 100644 --- a/exercises/concept/bird-count/.docs/hints.md +++ b/exercises/concept/bird-count/.docs/hints.md @@ -1,29 +1,29 @@ # Hints -### General +## General - The bird count per day is stored in a [instance variable][instace-variable] named `birds_per_day`. - The bird count per day is an array that contains exactly 7 integers. -### 1. Check what the counts were last week +## 1. Check what the counts were last week - As this method does _not_ depend on the current week's count, it is defined as a [`class` method][class-method]. - There are [several ways to define an array][array-definition]. -### 2. Check how many birds visited yesterday +## 2. Check how many birds visited yesterday - Remember that the counts are ordered by day from oldest to most recent, with the last element representing today. - Accessing the second last element can be done either by using its (fixed) index (remember to start counting from zero) or by calculating its index using the [array's size][array-length]. -### 3. Calculate the total number of visiting birds +## 3. Calculate the total number of visiting birds - It's possible to calculate the sum of a collection using the [Array#sum][array-sum] method. -### 4. Calculate the number of busy days +## 4. Calculate the number of busy days - Ruby also provides a method for [counting elements on a collection][array-count] -### 5. Check if there was a day with no visiting birds +## 5. Check if there was a day with no visiting birds - There are some methods that can be use to check the existence on an element on a colection. For example [Enumerable#any?][enumerable-any] and [Enumerable#all?][enumerable-all] diff --git a/exercises/concept/bird-count/.docs/instructions.md b/exercises/concept/bird-count/.docs/instructions.md index 03a2f3e341..1d845f175c 100644 --- a/exercises/concept/bird-count/.docs/instructions.md +++ b/exercises/concept/bird-count/.docs/instructions.md @@ -4,7 +4,7 @@ You're an avid bird watcher that keeps track of how many birds have visited your You have five tasks, all dealing with the numbers of birds that visited your garden. -### 1. Check what the counts were last week +## 1. Check what the counts were last week For comparison purposes, you always keep a copy of last week's counts nearby, which were: 0, 2, 5, 3, 7, 8 and 4. Implement the `BirdCount.last_week` method that returns last week's counts: @@ -13,7 +13,7 @@ BirdCount.last_week # => [0, 2, 5, 3, 7, 8, 4] ``` -### 2. Check how many birds visited yesterday +## 2. Check how many birds visited yesterday Implement the `BirdCount#yesterday` method to return how many birds visited your garden yesterday. The bird counts are ordered by day, with the first element being the count of the oldest day, and the last element being today's count. @@ -24,7 +24,7 @@ bird_count.yesterday # => 4 ``` -### 3. Calculate the total number of visiting birds +## 3. Calculate the total number of visiting birds Implement the `BirdCount#total` method to return the total number of birds that have visited your garden: @@ -35,7 +35,7 @@ bird_count.total # => 19 ``` -### 4. Calculate the number of busy days +## 4. Calculate the number of busy days Some days are busier that others. A busy day is one where five or more birds have visited your garden. Implement the `BirdCount#busy_days` method to return the number of busy days: @@ -47,7 +47,7 @@ bird_count.busy_days # => 2 ``` -### 5. Check if there was a day with no visiting birds +## 5. Check if there was a day with no visiting birds Implement the `BirdCount#day_without_birds?` method that returns `true` if there was a day at which zero birds visited the garden; otherwise, return `false`: diff --git a/exercises/concept/bird-count/.docs/introduction.md b/exercises/concept/bird-count/.docs/introduction.md index a8c9bfcfd4..9633f123f0 100644 --- a/exercises/concept/bird-count/.docs/introduction.md +++ b/exercises/concept/bird-count/.docs/introduction.md @@ -3,7 +3,7 @@ In Ruby, **arrays** are ordered, integer-indexed collections of any object. Array indexing starts at `0`. A negative index is assumed to be relative to the end of the array — i.e. an index of `-1` indicates the last element of the array, `-2` is the next to last element in the array, and so on. Ruby arrays mix in the [Enumerable module][enumerable-module], which adds several traversal and searching methods, and with the ability to sort. -### Create array. +## Create array. - An array in Ruby can contain different types of objects. @@ -11,7 +11,7 @@ Ruby arrays mix in the [Enumerable module][enumerable-module], which adds severa array = [1, "two", 3.0] #=> [1, "two", 3.0] ``` -### Element Assignment +## Element Assignment Elements can accessed or changed using indexes. Subarrays can be accessed by specifying a start index and a size. @@ -31,7 +31,7 @@ a[-1] = "Z" a #=> ["a", "Z"] ``` -### Element Reference +## Element Reference - Elements in an array can be retrieved using the #[] method. It returns the element at index, or returns a subarray starting at the start index and continuing for length elements. @@ -52,7 +52,7 @@ a[-2] #=> "d" a[-3, 3] #=> [ "c", "d", "e" ] ``` -### Obtaining Information about an Array +## Obtaining Information about an Array Arrays keep track of their own length at all times. To query an array about the number of elements it contains, use length, count or size. @@ -63,7 +63,7 @@ browsers.count #=> 5 browsers.size #=> 5 ``` -### Adding Items to Arrays +## Adding Items to Arrays Items can be added to the end of an array by using either push or << @@ -73,7 +73,7 @@ arr.push(5) #=> [1, 2, 3, 4, 5] arr << 6 #=> [1, 2, 3, 4, 5, 6] ``` -### Removing Items from an Array +## Removing Items from an Array The method pop removes the last element in an array and returns it