Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/generate
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require_relative '../lib/helper'
require 'generator'

paths = Generator::Paths.new(track: EXERCISM_RUBY_ROOT, metadata: METADATA_REPOSITORY_PATH)
paths = Generator::Paths.new(track: EXERCISM_RUBY_ROOT, docs: EXERCISM_RUBY_DOCS, metadata: METADATA_REPOSITORY_PATH)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs: is not an appropriate argument here, the docs path should be derived from the track: EXERCISM_RUBY_ROOT


generators = Generator::CommandLine.new(paths).parse(ARGV)
exit 1 unless generators
Expand Down
2 changes: 2 additions & 0 deletions docs/EXERCISE_README_INSERT.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/acronym/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Acronym
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have all the titles disappeared?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The titles disappeared because the original problem-specfications/description.md don't have it in them.

Accumulate README from problem-specfications:
https://github.com/exercism/problem-specifications/blob/master/exercises/accumulate/description.md

Ruby's Accumulate README:
https://github.com/exercism/ruby/blob/master/exercises/accumulate/README.md

I was thinking about adding the titles into the description.md of problem-specifications for every problem so that when generator gets run the titles don't disappear.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a read through this thread an the associated issues/PRs:
exercism/problem-specifications#767

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And: https://github.com/Insti/trackler/blob/master/lib/trackler/implementation.rb#L87
For the code that used to (/still does) generate the readmes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Things are a bit more complicated than normal right now as we're trying to make sure that the exercises are compatible with both the existing exercism.io site and the new https://v2.exercism.io/ (nextercism) site that have slightly different requirements.
It is nextercism that requires that the track have local README.md files.


Convert a phrase to its acronym.

Techies love their TLA (Three Letter Acronyms)!
Expand Down Expand Up @@ -32,10 +30,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

Julien Vanier [https://github.com/monkbroc](https://github.com/monkbroc)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
4 changes: 0 additions & 4 deletions exercises/all-your-base/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# All Your Base

Convert a number, represented as a sequence of digits in one base, to any other base.

Implement general base conversion. Given a number in base **a**,
Expand Down Expand Up @@ -55,7 +53,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb



## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
4 changes: 0 additions & 4 deletions exercises/alphametics/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Alphametics

Write a function to solve alphametics puzzles.

[Alphametics](https://en.wikipedia.org/wiki/Alphametics) is a puzzle where
Expand Down Expand Up @@ -55,7 +53,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb



## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/anagram/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Anagram

Given a word and a list of possible anagrams, select the correct sublist.

Given `"listen"` and a list of candidates like `"enlists" "google"
Expand Down Expand Up @@ -30,10 +28,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

Inspired by the Extreme Startup game [https://github.com/rchatley/extreme_startup](https://github.com/rchatley/extreme_startup)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/beer-song/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Beer Song

Produce the lyrics to that beloved classic, that field-trip favorite: 99 Bottles of Beer on the Wall.

Note that not all verses are identical.
Expand Down Expand Up @@ -344,10 +342,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

Learn to Program by Chris Pine [http://pine.fm/LearnToProgram/?Chapter=06](http://pine.fm/LearnToProgram/?Chapter=06)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/binary/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Binary

Convert a binary number, represented as a string (e.g. '101010'), to its decimal equivalent using first principles.

Implement binary to decimal conversion. Given a binary input
Expand Down Expand Up @@ -52,10 +50,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

All of Computer Science [http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-](http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/bob/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Bob

Bob is a lackadaisical teenager. In conversation, his responses are very limited.

Bob answers 'Sure.' if you ask him a question.
Expand Down Expand Up @@ -35,10 +33,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

Inspired by the 'Deaf Grandma' exercise in Chris Pine's Learn to Program tutorial. [http://pine.fm/LearnToProgram/?Chapter=06](http://pine.fm/LearnToProgram/?Chapter=06)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/bowling/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Bowling

Score a bowling game.

Bowling is game where players roll a heavy ball to knock down pins
Expand Down Expand Up @@ -70,10 +68,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

The Bowling Game Kata at but UncleBob [http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata](http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/bracket-push/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Bracket Push

Given a string containing brackets `[]`, braces `{}` and parentheses `()`,
verify that all the pairs are matched and nested correctly.

Expand Down Expand Up @@ -27,10 +25,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

Ginna Baker

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
42 changes: 42 additions & 0 deletions exercises/change/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Correctly determine the fewest number of coins to be given to a customer such
that the sum of the coins' value would equal the correct amount of change.

## For example

- An input of 15 with [1, 5, 10, 25, 100] should return one nickel (5)
and one dime (10) or [0, 1, 1, 0, 0]
- An input of 40 with [1, 5, 10, 25, 100] should return one nickel (5)
and one dime (10) and one quarter (25) or [0, 1, 1, 1, 0]

## Edge cases

- Does your algorithm work for any given set of coins?
- Can you ask for negative change?
- Can you ask for a change value smaller than the smallest coin value?

* * * *

For installation and learning resources, refer to the
[exercism help page](http://exercism.io/languages/ruby).

For running the tests provided, you will need the Minitest gem. Open a
terminal window and run the following command to install minitest:

gem install minitest

If you would like color output, you can `require 'minitest/pride'` in
the test file, or note the alternative instruction, below, for running
the test file.

In order to run the test, you can run the test file from the exercise
directory. For example, if the test suite is called
`hello_world_test.rb`, you can run the following command:

ruby hello_world_test.rb

To include color from the command line:

ruby -r minitest/pride hello_world_test.rb

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/clock/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Clock

Implement a clock that handles times without dates.

You should be able to add and subtract minutes to it.
Expand Down Expand Up @@ -30,10 +28,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

Pairing session with Erin Drummond [https://twitter.com/ebdrummond](https://twitter.com/ebdrummond)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/collatz-conjecture/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Collatz Conjecture

The Collatz Conjecture or 3x+1 problem can be summarized as follows:

Take any positive integer n. If n is even, divide n by 2 to get n / 2. If n is
Expand Down Expand Up @@ -50,10 +48,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

An unsolved problem in mathematics named after mathematician Lothar Collatz [https://en.wikipedia.org/wiki/3x_%2B_1_problem](https://en.wikipedia.org/wiki/3x_%2B_1_problem)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
4 changes: 0 additions & 4 deletions exercises/connect/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Connect

Compute the result for a game of Hex / Polygon.

The abstract boardgame known as
Expand Down Expand Up @@ -54,7 +52,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb



## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
4 changes: 0 additions & 4 deletions exercises/custom-set/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Custom Set

Create a custom set type.

Sometimes it is necessary to define a custom data structure of some
Expand Down Expand Up @@ -31,7 +29,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb



## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/difference-of-squares/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Difference Of Squares

Find the difference between the square of the sum and the sum of the squares of the first N natural numbers.

The square of the sum of the first ten natural numbers is
Expand Down Expand Up @@ -36,10 +34,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

Problem 6 at Project Euler [http://projecteuler.net/problem=6](http://projecteuler.net/problem=6)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
4 changes: 0 additions & 4 deletions exercises/dominoes/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Dominoes

Make a chain of dominoes.

Compute a way to order a given set of dominoes in such a way that they form a
Expand Down Expand Up @@ -38,7 +36,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb



## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/etl/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Etl

We are going to do the `Transform` step of an Extract-Transform-Load.

### ETL
Expand Down Expand Up @@ -68,10 +66,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

The Jumpstart Lab team [http://jumpstartlab.com](http://jumpstartlab.com)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/gigasecond/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Gigasecond

Calculate the moment when someone has lived for 10^9 seconds.

A gigasecond is 10^9 (1,000,000,000) seconds.
Expand Down Expand Up @@ -28,10 +26,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

Chapter 9 in Chris Pine's online Learn to Program tutorial. [http://pine.fm/LearnToProgram/?Chapter=09](http://pine.fm/LearnToProgram/?Chapter=09)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/grains/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Grains

Calculate the number of grains of wheat on a chessboard given that the number
on each square doubles.

Expand Down Expand Up @@ -51,10 +49,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

JavaRanch Cattle Drive, exercise 6 [http://www.javaranch.com/grains.jsp](http://www.javaranch.com/grains.jsp)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/hamming/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Hamming

Calculate the Hamming difference between two DNA strands.

A mutation is simply a mistake that occurs during the creation or
Expand Down Expand Up @@ -59,10 +57,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

The Calculating Point Mutations problem at Rosalind [http://rosalind.info/problems/hamm/](http://rosalind.info/problems/hamm/)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/hello-world/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Hello World

The classical introductory exercise. Just say "Hello, World!".

["Hello, World!"](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program) is
Expand Down Expand Up @@ -38,10 +36,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

This is an exercise to introduce users to using Exercism [http://en.wikipedia.org/wiki/%22Hello,_world!%22_program](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
7 changes: 0 additions & 7 deletions exercises/isogram/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Isogram

Determine if a word or phrase is an isogram.

An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter.
Expand Down Expand Up @@ -36,10 +34,5 @@ To include color from the command line:

ruby -r minitest/pride hello_world_test.rb


## Source

Wikipedia [https://en.wikipedia.org/wiki/Isogram](https://en.wikipedia.org/wiki/Isogram)

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
Loading