Skip to content

Update docs on windows #730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 17, 2018
Merged
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: 0 additions & 2 deletions bin/fetch-configlet
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ case $(uname) in
echo "mac";;
(Linux*)
echo "linux";;
(Windows*)
echo "windows";;
(*)
echo "linux";;
esac)
Expand Down
30 changes: 30 additions & 0 deletions bin/fetch-configlet.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Function RedirectLocationHeader([string]$url) {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

$latest = "https://github.com/exercism/configlet/releases/latest"
$request = [System.Net.WebRequest]::Create($latest)
$request.AllowAutoRedirect = $false
$response = $request.GetResponse()

$response.GetResponseHeader("Location")
}

Function LatestVersion {
$location = RedirectLocationHeader("https://github.com/exercism/configlet/releases/latest")
$location.Substring($location.LastIndexOf("/") + 1)
}

Function Arch {
If ([Environment]::Is64BitOperatingSystem) { "64bit" } Else { "32bit" }
}

$arch = Arch
$version = LatestVersion
$fileName = "configlet-windows-$arch.zip"
$url = "https://github.com/exercism/configlet/releases/download/$version/$filename"
$outputDirectory = "bin"
$outputFile = Join-Path -Path $outputDirectory -ChildPath $fileName

Invoke-WebRequest -Uri $url -OutFile $outputFile
Expand-Archive $outputFile -DestinationPath $outputDirectory -Force
Remove-Item -Path $outputFile
13 changes: 13 additions & 0 deletions exercises/list-ops/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ In functional languages list operations like `length`, `map`, and
`reduce` are very common. Implement a series of basic list operations,
without using existing functions.

The precise number and names of the operations to be implemented will be
track dependent to avoid conflicts with existing names, but the general
operations you will implement include:

* `append` (*given two lists, add all items in the second list to the end of the first list*);
* `concatenate` (*given a series of lists, combine all items in all lists into one flattened list*);
* `filter` (*given a predicate and a list, return the list of all items for which `predicate(item)` is True*);
* `length` (*given a list, return the total number of items within it*);
* `map` (*given a function and a list, return the list of the results of applying `function(item)` on all items*);
* `foldl` (*given a function, a list, and initial accumulator, fold (reduce) each item into the accumulator from the left using `function(accumulator, item)`*);
* `foldr` (*given a function, a list, and an initial accumulator, fold (reduce) each item into the accumulator from the right using `function(item, accumulator)`*);
* `reverse` (*given a list, return a list with all the original items, but in reversed order*);

## Hints
The `Foldl` and `Foldr` methods are "fold" functions, which is a concept well-known in the functional programming world, but less so in the object-oriented one. If you'd like more background information, check out this [fold](https://en.wikipedia.org/wiki/Fold_(higher-order_function)) page.

Expand Down
16 changes: 16 additions & 0 deletions exercises/wordy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

Parse and evaluate simple math word problems returning the answer as an integer.

## Iteration 0 — Numbers

Problems with no operations simply evaluate to the number given.

> What is 5?

Evaluates to 5.

## Iteration 1 — Addition

Add two numbers together.
Expand Down Expand Up @@ -43,6 +51,14 @@ left-to-right, _ignoring the typical order of operations._

15 (i.e. not 9)

## Iteration 4 — Errors

The parser should reject:

* Unsupported operations ("What is 52 cubed?")
* Non-math questions ("Who is the President of the United States")
* Word problems with invalid syntax ("What is 1 plus plus 2?")

## Bonus — Exponentials

If you'd like, handle exponentials.
Expand Down
3 changes: 3 additions & 0 deletions update-docs.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.\bin\fetch-configlet
.\bin\configlet generate .
Get-ChildItem -File -Path ".\config\patches" -Filter *.patch | % {& git apply $_.FullName}