Skip to content

Commit

Permalink
[v3] Markdown sub-headings must be parent level incremented by one.
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom committed Feb 12, 2021
1 parent d358c8a commit 0d8624c
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions concepts/floating-point-numbers/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions docs/RESOURCES.md
Original file line number Diff line number Diff line change
@@ -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/)
12 changes: 6 additions & 6 deletions exercises/concept/bird-count/.docs/hints.md
Original file line number Diff line number Diff line change
@@ -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]

Expand Down
10 changes: 5 additions & 5 deletions exercises/concept/bird-count/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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.

Expand All @@ -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:

Expand All @@ -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:
Expand All @@ -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`:

Expand Down
12 changes: 6 additions & 6 deletions exercises/concept/bird-count/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
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.

```ruby
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.

Expand All @@ -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.

Expand All @@ -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.

Expand All @@ -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 <<

Expand All @@ -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

Expand Down

0 comments on commit 0d8624c

Please sign in to comment.