Skip to content
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

[v3] Update Markdown files to latest spec #3

Closed
wants to merge 327 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
327 commits
Select commit Hold shift + click to select a range
c12bed0
Add Properties Exercise
mikedamay Apr 2, 2020
77dd9b8
Corrected invalid Json token
mikedamay Apr 2, 2020
318fe85
Add parentheses to method names
ErikSchierboom Apr 2, 2020
4ca05e1
Add syntax examples to after document of Strings exercise
ErikSchierboom Apr 2, 2020
64045ee
Make after.md required
ErikSchierboom Apr 2, 2020
a2de702
Improve Skip string #1047
wolf99 Apr 3, 2020
197b49a
Add syntax mention to after.md document description
ErikSchierboom Apr 3, 2020
762e468
Simplify concepts
ErikSchierboom Apr 1, 2020
361e6f6
Update exercise names
ErikSchierboom Apr 2, 2020
af855a7
Add set enum member value hints
ErikSchierboom Apr 4, 2020
1f6d77f
Add syntax examples to after document of numbers-floating-point …
ErikSchierboom Apr 4, 2020
9bae13d
Add syntax examples to after document of numbers exercise
ErikSchierboom Apr 4, 2020
f27df29
Add syntax examples to after document of enums-advanced exercise
ErikSchierboom Apr 4, 2020
c05b215
Add syntax example to after document of Enums exercise
ErikSchierboom Apr 4, 2020
2709085
Simplified basic-enums exercise by removing parsing
iHiD Apr 7, 2020
5996a98
Add note about scope
ErikSchierboom Apr 9, 2020
4d21fc3
Change switch concept name
ErikSchierboom Apr 9, 2020
bd2f7b0
Add source and versioninfo to exercise config
iHiD Apr 9, 2020
1e4ae8a
Remove unused examples
ErikSchierboom Apr 10, 2020
63a8279
Add reference to required reading in implementing guide
ErikSchierboom Apr 10, 2020
c534232
Use updated config.json format
ErikSchierboom Apr 10, 2020
38dd98d
Add reference to Concept Exercise Anatomy video
ErikSchierboom Apr 14, 2020
0ddba0a
Skip analyzer and representer steps if unclear
ErikSchierboom Apr 14, 2020
d13466c
Add equality operators to numbers exercise
ErikSchierboom Apr 16, 2020
2c7a415
Format using Prettier
ErikSchierboom Apr 16, 2020
c0ea68b
Normalize code
ErikSchierboom Apr 17, 2020
7927105
Allow code to be formatted automatically
ErikSchierboom Apr 17, 2020
f876ac8
Add named parameter reference to basics exercise
ErikSchierboom Apr 18, 2020
af5a3ed
update header reference wording
efx Apr 21, 2020
234dbfe
Update hints.md
kmjones77 Apr 21, 2020
e03e4c7
Update implementing-a-concept-exercise.md
kmjones77 Apr 21, 2020
311e1df
add auto formatting support
ErikSchierboom Apr 22, 2020
1ad49a2
New Concept Exercise: arrays
ErikSchierboom Apr 22, 2020
880ae07
Implement new Concept Exercise: nullability
maurelio1234 Apr 23, 2020
a0c63ed
Fix formatting
ErikSchierboom Apr 23, 2020
2fc57c6
Cross-reference concept exercise file information
ErikSchierboom Apr 23, 2020
c12f4aa
Update Microsoft.NET.Test.Sdk package to 16.6.0
ErikSchierboom Apr 23, 2020
4fda1f2
Fix missing space
ErikSchierboom Apr 24, 2020
7df2dcb
Simplify exercise and update documentation
ErikSchierboom Apr 23, 2020
929bf42
Remove unneeded class access modifier
ErikSchierboom Apr 29, 2020
df32d77
Use consistent method references
ErikSchierboom May 1, 2020
34683b1
Simplify classes
ErikSchierboom May 1, 2020
8213980
Add classes exercise
ErikSchierboom May 2, 2020
0a7bca8
Use consistent todo text
ErikSchierboom May 6, 2020
bcfc1aa
Add constructors exercise
ErikSchierboom May 7, 2020
7ceef5b
Add booleans exercise
ErikSchierboom May 8, 2020
055ff8d
Minor instructions consistency fix
ErikSchierboom May 8, 2020
14bfc3a
Cleanup
ErikSchierboom May 8, 2020
384efbb
Add inheritance exercise
ErikSchierboom May 15, 2020
8c24cfb
Minor corrections to document
mikedamay May 15, 2020
c67b0ee
Update test naming
ErikSchierboom May 16, 2020
8ed37e1
Use basic syntax
ErikSchierboom May 19, 2020
9ad600f
Add mutation
ErikSchierboom May 19, 2020
3ed42b7
Add method-overloading exercise
ErikSchierboom May 19, 2020
9137be0
Add note that test methods should have just one assertion
ErikSchierboom May 22, 2020
be4f16f
Use consistent headings in documentation
ErikSchierboom May 22, 2020
dcc2744
add dictionaries exercise
mikedamay May 26, 2020
c725076
Add digit separator notation to numbers exercise
ErikSchierboom May 26, 2020
49b76e8
Introduce for loops in arrays exercise
ErikSchierboom May 27, 2020
96b2539
Add related topics to arrays exercise
mikedamay May 29, 2020
063c1fe
Remove top-level header from design.md files
ErikSchierboom May 29, 2020
7d2e7d4
Add compound assignment concept to flag-enums exercise
ErikSchierboom Jun 1, 2020
3cd3bfa
Improve elapsed time for basics exercise
ErikSchierboom Jun 1, 2020
3dea963
Remove unneeded representer and analyzer sections
ErikSchierboom Jun 1, 2020
4f559fb
fix typo in basics exercise
mirkoperillo Jun 2, 2020
cb9351a
Remove goal from design.md
ErikSchierboom Jun 2, 2020
0c9ae83
remove unused link ref
mirkoperillo Jun 9, 2020
0279182
Put concept out-of-scope
mikedamay Jun 9, 2020
9b9023b
New concept exerise: `enum`
angelikatyborska Jun 9, 2020
3d83bfc
Add chars exercise
mikedamay Jun 11, 2020
9b6e0fb
inheritance elaborate on sealed classes
mikedamay Jun 11, 2020
7ee12cd
Remove duplicate datetime format from the appointment scheduler story
angelikatyborska Jun 15, 2020
546febe
added pre-requisite
mikedamay Jun 16, 2020
06e2ed6
Fix test name filenames
ErikSchierboom Jun 16, 2020
9d628d2
Add exercise User-defined Exceptions
mikedamay Jun 17, 2020
f8b7748
Implement Tuples Exercise
mikedamay Jun 24, 2020
53d6af3
Add randomness Concept Exercise
mikedamay Jun 25, 2020
f78fa04
Implemented Concept exercise: equality
mikedamay Jun 26, 2020
98dac09
Remove aa-template files
ErikSchierboom Jun 26, 2020
2e55110
Add analyzer and representer functionality
mikedamay Jun 28, 2020
dc816ff
remove unused link reference
mirkoperillo Jun 30, 2020
65e3618
remove unused link reference
mirkoperillo Jun 30, 2020
7e11988
added concept exercise: parameters
mikedamay Jun 30, 2020
0f84eb6
added color to after.md on chars
mikedamay Jul 1, 2020
09d80d3
object-initializers new concept exercise
mikedamay Jul 1, 2020
acb9f6e
randomness - updated sets concept
mikedamay Jul 2, 2020
95e4c01
time new exercise
mikedamay Jul 3, 2020
66a42d3
resource-cleanup new exercise
mikedamay Jul 3, 2020
3dc0a37
switch statements new exercise
mikedamay Jul 3, 2020
d1adf47
concept exercises
mikedamay Jul 3, 2020
d906920
casting new exercise
mikedamay Jul 8, 2020
355f912
structs new exercise
mikedamay Jul 9, 2020
cd9a05b
regular expressions new exercise
mikedamay Jul 11, 2020
7105698
Update instructions.md
mikedamay Jul 13, 2020
1800306
Add after note in design.md document
ErikSchierboom Jul 14, 2020
de9b7b5
overflow new exercise
mikedamay Jul 14, 2020
1b3816e
resource-lifetime new exercise
mikedamay Jul 14, 2020
76a20ff
Update hints.md
mikedamay Jul 14, 2020
70ca5e4
nested-types new exercise
mikedamay Jul 14, 2020
f0e6f6c
structs - added contributors
mikedamay Jul 14, 2020
80be01b
misspelling of "prerequisiites" in multiple files
mikedamay Jul 15, 2020
16d80d8
Add new object mention in basics introduction
ErikSchierboom Jul 15, 2020
456526d
various - added contributors
mikedamay Jul 16, 2020
413e8fa
lists new exercise
mikedamay Jul 16, 2020
26078d3
string-formatting new exercise
mikedamay Jul 21, 2020
0e49e95
namespaces new exercise
mikedamay Jul 21, 2020
a0cf957
minor enhancement to after.md
mikedamay Jul 29, 2020
d6147f3
integral-numbers new exercise
mikedamay Jul 31, 2020
9080dee
interfaces new exercise
mikedamay Jul 31, 2020
16d493c
operator-overloading new exercise
mikedamay Aug 6, 2020
b81dde7
expression-bodied-members new exercise
mikedamay Aug 6, 2020
5bf3daf
constants new exercise
mikedamay Aug 6, 2020
5b9a697
Added Exceptions exercise
archrisV Aug 6, 2020
8b610c0
fix LogLevel method
bobbicodes Aug 7, 2020
9b41d44
Update after.md
mikedamay Aug 15, 2020
e2bcb05
new csharp exercise report action and revised reference/README.md
mikedamay Aug 20, 2020
0237274
clean-concepts - allocated some unallocated concepts
mikedamay Aug 25, 2020
972ba7a
Update exercise-report document
github-actions[bot] Aug 25, 2020
8e6f8bc
clean concepts 2
mikedamay Aug 26, 2020
f3e8754
Update exercise-report document
github-actions[bot] Aug 26, 2020
941d948
invalid-design-format Fix poorly formatted design.md files
mikedamay Aug 27, 2020
d63a369
Update exercise-report document
github-actions[bot] Aug 27, 2020
09262a0
clean concepts 3
mikedamay Aug 28, 2020
c73c940
Update exercise-report document
github-actions[bot] Aug 28, 2020
5d36a8c
Fix example of strings exercise
ErikSchierboom Sep 2, 2020
f986ecb
Fix invalid example test name for dictionaries exercise
ErikSchierboom Sep 2, 2020
d5ad19a
clean-concepts-4 added concepts to design.md docs
mikedamay Sep 3, 2020
c216391
Update exercise-report document
github-actions[bot] Sep 3, 2020
f27ce25
Update after.md
mikedamay Sep 11, 2020
7f68ac5
issue #2250 mismatch between exercises.json and config.json
mikedamay Sep 17, 2020
b212dd6
Update exercise-report document
github-actions[bot] Sep 17, 2020
5dfbafb
Fix typos on exceptions concept exercise
pvcarrera Oct 10, 2020
86f175c
Add stubs for concept documents
ErikSchierboom Oct 14, 2020
acad53e
remove enum from config and from the switch exercise
valentin-p Oct 21, 2020
499d02e
tuples - replace about.md file with concept files
ErikSchierboom Oct 21, 2020
5a3c774
structs - replace about.md file with concept files
ErikSchierboom Oct 21, 2020
706f3f5
strings - replace about.md file with concept files
ErikSchierboom Oct 21, 2020
27c8fa2
user-defined-exceptions - replace about.md file with concept files
ErikSchierboom Oct 21, 2020
40eb6c2
time - replace about.md file with concept files
ErikSchierboom Oct 21, 2020
6cbc81c
resource-lifetime - replace about.md file with concept files
ErikSchierboom Oct 21, 2020
fd4d22e
resource-cleanup - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
7a78726
randomness - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
7f88884
properties - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
3c01826
parameters - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
bca5f50
operator-overloading - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
9a49851
object-initializers - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
203d281
nullability - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
5c45eeb
string-formatting - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
e2bc7c5
regular-expressions - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
77ae992
lists - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
7599c32
method-overloading - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
eea85c6
namespaces - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
592a66c
nested-types - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
dc603f6
numbers - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
de13661
overflow - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
d4d9030
interfaces - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
a8443f8
integral-numbers - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
026d9c3
inheritance - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
511c09d
exceptions - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
56f1d6f
dictionaries - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
08455fd
datetimes - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
10e4a34
constructors - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
cfdf670
classes - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
9399aa8
flag-enums - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
149518b
expression-bodied-members - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
9b4e34c
equality - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
d9c5914
enums - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
82b6766
booleans - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
32444fd
basics - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
790593e
constants - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
9c8ef9d
casting - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
f2ec160
chars - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
f604a37
arrays - replace about.md file with concept files
ErikSchierboom Oct 22, 2020
aa74e74
switch-statements - (manual) replace about.md file with concept files
mikedamay Oct 27, 2020
fcbf2bb
Fix typos
valentin-p Oct 27, 2020
ce99c25
floating-point-numbers - replace about.md file with concept files
ErikSchierboom Oct 27, 2020
0968bd3
Fix Struct Tests to build out of the box.
thecouchcoder Oct 29, 2020
d98f45e
strings - add concatenation to introduction
thecouchcoder Oct 29, 2020
ee44f3a
Add editor key to exercises
ErikSchierboom Oct 31, 2020
5ed2d41
Rename exercises
ErikSchierboom Nov 4, 2020
37d7971
Update exercise-report document
github-actions[bot] Nov 4, 2020
20befd8
Add headings to introductions
ErikSchierboom Nov 5, 2020
da36343
dictionary ex. tests with only one assert. merged
valentin-p Nov 5, 2020
044b426
instructions.md for empty string
valentin-p Nov 5, 2020
5bf0e1d
rename high school sweethearts classes
mikedamay Nov 6, 2020
b9c0b0c
minor concept changes
mikedamay Nov 7, 2020
b56cb10
format multiple files
valentin-p Nov 10, 2020
c2a4f71
calculator cyclic dep improv 2314
valentin-p Nov 11, 2020
61e5a0c
Add description of concept documents
ErikSchierboom Nov 11, 2020
8c98242
Fix package versions
ErikSchierboom Nov 11, 2020
ca7ae4e
replace conditionals with if-statements
valentin-p Nov 12, 2020
1ec8fd7
Upgrade to .NET 5
ErikSchierboom Nov 17, 2020
f401944
Basics concept. detailing variable names
valentin-p Nov 17, 2020
bc8529c
Namespace concept. Red vs Blue. Tests
valentin-p Nov 17, 2020
7e66e90
consolidate references to arithmetic-overflow and overflow
mikedamay Nov 17, 2020
4b5486c
datetimes. Constructor for test culture en us
valentin-p Nov 18, 2020
159b5cd
keep only concept datetimes
valentin-p Nov 18, 2020
275f558
rename exercise to developer-privileges
mikedamay Nov 18, 2020
dbac642
classes concept - ensured related scraped concepts were included
mikedamay Nov 19, 2020
bc9bdec
Update exercise-report document
github-actions[bot] Nov 19, 2020
5ebd791
elons-toys - removed concepts from design.md
mikedamay Nov 19, 2020
0f2d7d4
Update exercise-report document
github-actions[bot] Nov 19, 2020
7459d90
international-calling-connoisseur - reformat instructions.md.
mikedamay Nov 20, 2020
2aca136
Format code
SaschaMann Nov 24, 2020
2470fa0
attack trolls. flag enums and attributes
valentin-p Dec 4, 2020
c24a0b0
Update exercise-report document
github-actions[bot] Dec 6, 2020
33039c5
polymorphism concept
mikedamay Dec 10, 2020
719466f
enums concept about.md
valentin-p Dec 11, 2020
437304c
Add clarification that new instances are unique
ErikSchierboom Dec 22, 2020
9eba3de
Revert change to classes concept documentation
ErikSchierboom Dec 22, 2020
4a8cf43
Do-while loop context
ErikSchierboom Dec 22, 2020
b86a835
Fix typo in named-arguments concept doc
ErikSchierboom Dec 22, 2020
15cf6bc
Minor tweaks to Boolean instructions.
taiyab Jan 8, 2021
0d28c7d
Cleanup instructions headings
ErikSchierboom Jan 12, 2021
3e87a04
Add concept introductions
ErikSchierboom Jan 12, 2021
40d4ab2
Move custom docs to reference folder
ErikSchierboom Jan 13, 2021
d6e1ff2
luciens-lasagna/basics story fix
mikedamay Jan 20, 2021
567dd9a
ensure that all basics concepts are mentioned in about.md and files a…
mikedamay Jan 20, 2021
8f33c41
Convert example to exemplar
ErikSchierboom Jan 28, 2021
b865b2f
Convert editor key in .meta/config.json files
ErikSchierboom Jan 29, 2021
0a5c96e
[v3] Move existing exercises to exercises/practice
ErikSchierboom Jan 29, 2021
d758bed
[v3] Add version property to config.json
ErikSchierboom Jan 29, 2021
dab25a6
[v3] Add status to config.json
ErikSchierboom Jan 29, 2021
c9543f2
[v3] Add slug to config.json
ErikSchierboom Jan 29, 2021
8661dac
[v3] Add status for deprecated practice exercises in config.json
ErikSchierboom Jan 29, 2021
ea8be38
[v3] Re-order practice exercises in config.json
ErikSchierboom Jan 29, 2021
fbcd75f
[v3] Remove deprecated properties from practice exercises in config.json
ErikSchierboom Jan 29, 2021
b561b54
[v3] Add name property to practice exercises in config.json
ErikSchierboom Jan 29, 2021
67373dd
[v3] Add (empty) prerequisites property to practice exercises in conf…
ErikSchierboom Jan 29, 2021
79f2e8c
[v3] Move exercises to practice exercises property in config.json
ErikSchierboom Jan 29, 2021
dbf1ce9
[v3] Move foregone exercises to exercises property in config.json
ErikSchierboom Jan 29, 2021
8869795
[v3] Add concept exercises to config.json
ErikSchierboom Jan 29, 2021
71308e9
[v3] Add wip status to concept exercises in config.json
ErikSchierboom Jan 29, 2021
755503b
[v3] Add concepts to config.json
ErikSchierboom Jan 29, 2021
53a39f9
[v3] Add key features to config.json
ErikSchierboom Jan 29, 2021
72cccbe
[v3] Add tags to config.json
ErikSchierboom Jan 29, 2021
92e6076
[v3] Add configlet CI workflow
ErikSchierboom Jan 29, 2021
750a5e7
[v3] Update fetch-configlet script to work with configlet v3
ErikSchierboom Jan 29, 2021
a1a496a
[v3] Add dependabot to keep GHA dependencies up-to-date
ErikSchierboom Jan 29, 2021
d6e00cb
[v3] Convert relative v3 links to absolute links
ErikSchierboom Jan 29, 2021
edd6ea8
[v3] Fix configlet CI workflow
ErikSchierboom Jan 29, 2021
a4d3bba
Use net5.0 to run the tests (#1485)
valentin-p Feb 2, 2021
0d8c01a
Update status of track (#1487)
ErikSchierboom Feb 3, 2021
328798d
Add tags (#1486)
ErikSchierboom Feb 3, 2021
9adcf39
Fix configlet lint (#1488)
ErikSchierboom Feb 4, 2021
54961c0
nuget: bump Microsoft.NET.Test.Sdk to 16.8.3 (#1491)
ErikSchierboom Feb 9, 2021
fbb11de
projects: bump target framework to net5.0 (#1490)
ErikSchierboom Feb 9, 2021
b6069be
scripts: test practice and concept exercises (#1493)
ErikSchierboom Feb 9, 2021
5ace391
[v3] Add level one headings to Markdown files.
ErikSchierboom Feb 9, 2021
95adede
[v3] Markdown sub-headings must be parent level incremented by one.
ErikSchierboom Feb 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2

updates:

# Keep dependencies for GitHub Actions up-to-date
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
16 changes: 16 additions & 0 deletions .github/workflows/configlet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Configlet CI

on: [push, pull_request, workflow_dispatch]

jobs:
configlet:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f

- name: Fetch configlet
uses: exercism/github-actions/configlet-ci@main

- name: Configlet Linter
run: configlet lint
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # 2.3.4
- uses: actions/setup-dotnet@51f68377c181a79065c61bd492bd49be4575c439 # 1.7.2
with:
dotnet-version: "3.0.100"
dotnet-version: "5.0.102"
- run: pwsh ./test.ps1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91 changes: 56 additions & 35 deletions bin/fetch-configlet
Original file line number Diff line number Diff line change
@@ -1,37 +1,58 @@
#!/bin/bash

LATEST=https://api.github.com/repos/exercism/configlet/releases/latest

OS=$(
case $(uname) in
(Darwin*)
echo "mac";;
(Linux*)
echo "linux";;
(*)
echo "linux";;
esac)

ARCH=$(
case $(uname -m) in
(*64*)
echo 64bit;;
(*686*)
echo 32bit;;
(*386*)
echo 32bit;;
(*)
echo 64bit;;
esac)

FILENAME="configlet-${OS}-${ARCH}.tgz"

if [ -z "${GITHUB_TOKEN}" ]
then
HEADER=""
else
HEADER="authorization: Bearer ${GITHUB_TOKEN}"
#!/usr/bin/env bash

set -eo pipefail

readonly LATEST='https://api.github.com/repos/exercism/configlet/releases/latest'

case "$(uname)" in
Darwin*) os='mac' ;;
Linux*) os='linux' ;;
Windows*) os='windows' ;;
MINGW*) os='windows' ;;
MSYS_NT-*) os='windows' ;;
*) os='linux' ;;
esac

case "${os}" in
windows*) ext='zip' ;;
*) ext='tgz' ;;
esac

case "$(uname -m)" in
*64*) arch='64bit' ;;
*686*) arch='32bit' ;;
*386*) arch='32bit' ;;
*) arch='64bit' ;;
esac

curlopts=(
--silent
--show-error
--fail
--location
--retry 3
)

if [[ -n "${GITHUB_TOKEN}" ]]; then
curlopts+=(--header "authorization: Bearer ${GITHUB_TOKEN}")
fi

URL=$(curl --header $HEADER -s $LATEST | awk -v filename=$FILENAME '$1 ~ /browser_download_url/ && $2 ~ filename { print $2 }' | tr -d '"')
curl --header $HEADER -s --location $URL | tar xz -C bin/
suffix="${os}-${arch}.${ext}"

get_download_url() {
curl "${curlopts[@]}" --header 'Accept: application/vnd.github.v3+json' "${LATEST}" |
grep "\"browser_download_url\": \".*/download/.*/configlet.*${suffix}\"$" |
cut -d'"' -f4
}

download_url="$(get_download_url)"
output_dir="bin"
output_path="${output_dir}/latest-configlet.${ext}"
curl "${curlopts[@]}" --output "${output_path}" "${download_url}"

case "${ext}" in
*zip) unzip "${output_path}" -d "${output_dir}" ;;
*) tar xzf "${output_path}" -C "${output_dir}" ;;
esac

rm -f "${output_path}"
34 changes: 18 additions & 16 deletions bin/fetch-configlet.ps1
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
Function DownloadUrl ([string] $FileName, $Headers) {
$latestUrl = "https://api.github.com/repos/exercism/configlet/releases/latest"
$json = Invoke-RestMethod -Headers $Headers -Uri $latestUrl
$json.assets | Where-Object { $_.browser_download_url -match $FileName } | Select-Object -ExpandProperty browser_download_url
}
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"

Function Headers {
If ($GITHUB_TOKEN) { $headers = @{ Authorization = "Bearer ${GITHUB_TOKEN}" } } Else { $headers = @{ } }
$requestOpts = @{
Headers = If ($env:GITHUB_TOKEN) { @{ Authorization = "Bearer ${env:GITHUB_TOKEN}" } } Else { @{ } }
MaximumRetryCount = 3
RetryIntervalSec = 1
}

Function Arch {
If ([Environment]::Is64BitOperatingSystem) { "64bit" } Else { "32bit" }
$arch = If ([Environment]::Is64BitOperatingSystem) { "64bit" } Else { "32bit" }
$fileName = "configlet-windows-$arch.zip"

Function Get-DownloadUrl {
$latestUrl = "https://api.github.com/repos/exercism/configlet/releases/latest"
Invoke-RestMethod -Uri $latestUrl -PreserveAuthorizationOnRedirect @requestOpts
| Select-Object -ExpandProperty assets
| Where-Object { $_.browser_download_url -match $FileName }
| Select-Object -ExpandProperty browser_download_url
}

$arch = Arch
$headers = Headers
$fileName = "configlet-windows-$arch.zip"
$downloadUrl = Get-DownloadUrl
$outputDirectory = "bin"
$outputFile = Join-Path -Path $outputDirectory -ChildPath $fileName
$zipUrl = DownloadUrl -FileName $fileName -Headers $headers

Invoke-WebRequest -Headers $headers -Uri $zipUrl -OutFile $outputFile
Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
Expand-Archive $outputFile -DestinationPath $outputDirectory -Force
Remove-Item -Path $outputFile
Remove-Item -Path $outputFile
103 changes: 103 additions & 0 deletions concepts/arrays/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# About

TODO: about.md files and links.json files are the same for arrays, for-loops and foreach. Consider how to prise these apart of otherwise treat these closely coupled concepts.
Data structures that can hold zero or more elements are known as _collections_. An **array** is a collection that has a fixed size/length and whose elements must all be of the same type. Elements can be assigned to an array or retrieved from it using an index. C# arrays are zero-based, meaning that the first element's index is always zero:

```csharp
// Declare array with explicit size (size is 2)
int[] twoInts = new int[2];

// Assign second element by index
twoInts[1] = 8;

// Retrieve the second element by index
twoInts[1] == 8; // => true

// Check the length of the array
twoInts.Length == 2; // => true
```

Arrays can also be defined using a shortcut notation that allows you to both create the array and set its value. As the compiler can now tell how many elements the array will have, the length can be omitted:

```csharp
// Three equivalent ways to declare and initialize an array (size is 3)
int[] threeIntsV1 = new int[] { 4, 9, 7 };
int[] threeIntsV2 = new[] { 4, 9, 7 };
int[] threeIntsV3 = { 4, 9, 7 };
```

Arrays can be manipulated by either calling an array instance's [methods][array-methods] or [properties][array-properties], or by using the static methods defined in the [`Array` class][array-class].

An array is also a _collection_, which means that you can iterate over _all_ its values using a [`foreach` loop][foreach-statement]:

```csharp
char[] vowels = new [] { 'a', 'e', 'i', 'o', 'u' };

foreach (char vowel in vowels)
{
// Output the vowel
System.Console.Write(vowel);
}

// => aeiou
```

One could use a [`for` loop][for-statement] to iterate over an array:

```csharp
char[] vowels = new [] { 'a', 'e', 'i', 'o', 'u' };

for (int i = 0; i < vowels.Length; i++)
{
// Output the vowel
System.Console.Write(vowels[i]);
}

// => aeiou
```

However, generally a `foreach` loop is preferrable over a `for` loop for the following reasons:

- A `foreach` loop is guaranteed to iterate over _all_ values. With a `for` loop, it is easy to miss elements, for example due to an off-by-one error.
- A `foreach` loop is more _declarative_, your code is communicating _what_ you want it to do, instead of a `for` loop that communicates _how_ you want to do it.
- A `foreach` loop is foolproof, whereas with `for` loops it is easy to have an off-by-one error.
- A `foreach` loop works on all collection types, including those that don't support using an indexer to access elements.

To guarantee that a `foreach` loop will iterate over _all_ values, the compiler will not allow updating of a collection within a `foreach` loop:

```csharp
char[] vowels = new [] { 'a', 'e', 'i', 'o', 'u' };

foreach (char vowel in vowels)
{
// This would result in a compiler error
// vowel = 'Y';
}
```

A `for` loop does have some advantages over a `foreach` loop:

- You can start or stop at the index you want.
- You can use any (boolean) termination condition you want.
- You can skip elements by customizing the incrementing of the loop variable.
- You can process collections from back to front by counting down.
- You can use `for` loops in scenarios that don't involve collections.

Related Topics:

- You should be aware that C# supports [multi-dimensional arrays][multi-dimensional-arrays] like `int[,] arr = new int[10, 5]` which can be very useful.
- You should also be aware that you can instantiate objects of type [`System.Array`][system-array-object] with `Array.CreateInstance`. Such objects are of little use - mainly for interop with VB.NET code. They are not interchangeable with standard arrays (`T[]`). They can have a non-zero lower bound.

Both the above topics are discussed more fully in a later exercise.

[implicitly-typed-arrays]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/implicitly-typed-arrays
[array-foreach]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/using-foreach-with-arrays
[single-dimensional-arrays]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/single-dimensional-arrays
[array-class]: https://docs.microsoft.com/en-us/dotnet/api/system.array?view=netcore-3.1
[array-properties]: https://docs.microsoft.com/en-us/dotnet/api/system.array?view=netcore-3.1#properties
[array-methods]: https://docs.microsoft.com/en-us/dotnet/api/system.array?view=netcore-3.1#methods
[foreach-statement]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/foreach-in
[for-statement]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/for
[break-keyword]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/break
[multi-dimensional-arrays]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/multidimensional-arrays
[system-array-object]: https://docs.microsoft.com/en-us/dotnet/api/system.array.createinstance?view=netcore-3.1#System_Array_CreateInstance_System_Type_System_Int32_
25 changes: 25 additions & 0 deletions concepts/arrays/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Introduction

In C#, data structures that can hold zero or more elements are known as _collections_. An **array** is a collection that has a fixed size/length and whose elements must all be of the same type. Elements can be assigned to an array or retrieved from it using an index. C# arrays are zero-based, meaning that the first element's index is always zero:

```csharp
// Declare array with explicit size (size is 2)
int[] twoInts = new int[2];

// Assign second element by index
twoInts[1] = 8;

// Retrieve the second element by index
twoInts[1] == 8; // => true
```

Arrays can also be defined using a shortcut notation that allows you to both create the array and set its value. As the compiler can now tell how many elements the array will have, the length can be omitted:

```csharp
// Three equivalent ways to declare and initialize an array (size is 3)
int[] threeIntsV1 = new int[] { 4, 9, 7 };
int[] threeIntsV2 = new[] { 4, 9, 7 };
int[] threeIntsV3 = { 4, 9, 7 };
```

Arrays can be manipulated by either calling an array instance's methods or properties, or by using the static methods defined in the `Array` class.
30 changes: 30 additions & 0 deletions concepts/arrays/links.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[
{
"url": "https://docs.microsoft.com/en-us/dotnet/api/system.array?view=netcore-3.1#methods",
"description": "array-methods"
},
{
"url": "https://docs.microsoft.com/en-us/dotnet/api/system.array?view=netcore-3.1#properties",
"description": "array-properties"
},
{
"url": "https://docs.microsoft.com/en-us/dotnet/api/system.array?view=netcore-3.1",
"description": "array-class"
},
{
"url": "https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/foreach-in",
"description": "foreach-statement"
},
{
"url": "https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/for",
"description": "for-statement"
},
{
"url": "https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/arrays/multidimensional-arrays",
"description": "multi-dimensional-arrays"
},
{
"url": "https://docs.microsoft.com/en-us/dotnet/api/system.array.createinstance?view=netcore-3.1#System_Array_CreateInstance_System_Type_System_Int32_",
"description": "system-array-object"
}
]
30 changes: 30 additions & 0 deletions concepts/attributes/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# About

A [C# `Attribute`][attribute-concept] provides a way to decorate a declaration to associate metadata to: a class, a method, an enum, a field, a property or any [other supported][attribute-targets] declarations.

You can apply [an attribute][attribute] to a declaration by adding it between brackets `[]` before the declaration, the following example uses both a `ClassAttribute` and a `FieldAttribute`:

```csharp
[Class]
public class MyClass
{
[Field] public int myField;
}
```

The declarative metadata only associates additional structured information to the code and does not modify its behavior, but that metadata is used by other part of the code to change how its target would behave or add, change or remove, restrict some its functionalities.

Multiple predefined attributes exist like: `Flags`, `Obsolete`, `Conditional`. Note that the full name of the [`Flags` attribute][flags-attribute] is `FlagsAttribute`, but "Attribute" suffix can be omitted when using in the attribute.

The following four predefined attributes are used regularly:

- `[Flags]`: Predefined in the System namespace. Indicates the enum supports both bitwise operations and the method `Enum.HasFlag()`, additionally `ToString` would display all the flags: [see example][flags-example].
- `[Obsolete]`: Predefined in the System namespace. Allows to add a message about why the code is obsolete, it can be used to display compiler warnings or errors.
- `[Conditional]`: Predefined in the System.Diagnostics namespace. Allows to remove some method calls at compile time for debugging (diagnostics) purposes.
- `[CallerMemberName]`: Predefined in the System.Runtime.CompilerServices namespace. Allows a method to obtain information about its caller.

[attribute-concept]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/
[attribute]: https://docs.microsoft.com/en-us/dotnet/csharp/tutorials/attributes
[attribute-targets]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/#attribute-targets
[flags-attribute]: https://docs.microsoft.com/en-us/dotnet/api/system.flagsattribute?view=net-5.0
[flags-example]: https://docs.microsoft.com/en-us/dotnet/api/system.flagsattribute?view=net-5.0#examples
18 changes: 18 additions & 0 deletions concepts/attributes/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Introduction

A [C# `Attribute`](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/) provides a way to decorate a declaration to associate metadata to: a class, a method, an enum, a field, a property or any [other supported](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/#attribute-targets) declarations.

You can apply an attribute by adding it on the line before the declaration using a `ClassAttribute` and a `FieldAttribute`:

```csharp
[Class]
class MyClass
{
[Field]
int myField;
}
```

This declarative metadata only associates additional structured information to the code and does not modify its behavior, but that metadata is used by other part of the code to change how its target would behave or add, change or remove, restrict some its functionalities.

There is many [predefined and reserved attributes](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/general#conditional-attribute), for example: `Flags`, `Obsolete`, `Conditional`, each has a specific that can be looked up on the C# documentation. Note that the full name of an attribute like [`Flags`](https://docs.microsoft.com/en-us/dotnet/api/system.flagsattribute?view=net-5.0) is `FlagsAttribute` by convention, but the suffix _Attribute_ can be omitted when applied on a declaration.
Loading