Skip to content

Commit

Permalink
🚧 🎨 Rework Koan Order (#277)
Browse files Browse the repository at this point in the history
* 🚧 Move KoanOrder file

* 📝 🎨 Update KoanIndex file

- Reformat table in koan index

- Update note in KoanIndex File

- Remove Module column in favour of using separate tables with headings.

- Move links to bottom of file to neaten table.

* 📝 Update vscode json files

* 📝 Reorder the Introduction segment
- Move AboutBooleans to 102
- Update AboutBooleans.
- Move AboutNumbers to 103
- Update AboutNumbers
- Move AboutStrings to 104
- Move AboutBinary to 107

* 🚧 Update order for Foundations

* 🎨 Add missing newline

* 🎨 Use consistent quoting in AboutBooleans

* 🚧 Fix up katas
- Add missing kata to index
- Rename stock challenge to match new kata style

* 📝 add symbol for incomplete topics
  • Loading branch information
vexx32 committed Oct 2, 2019
1 parent 75356b1 commit 41ea730
Show file tree
Hide file tree
Showing 15 changed files with 174 additions and 98 deletions.
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"recommendations": [
"ms-vscode.PowerShell",
"ms-vscode.PowerShell-Preview",
"streetsidesoftware.code-spell-checker"
"streetsidesoftware.code-spell-checker",
"yzhang.markdown-all-in-one"
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"cSpell.words": [
"Cmdlet",
"Cmdlets",
"Dbatools",
"Hashtables",
"Katas"
]
}
108 changes: 108 additions & 0 deletions KoanIndex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# PSKoans Topic Index

Below are tables of all koan topics and their corresponding positions.
When adding or updating koan topics, please keep this file up to date.

> Draft / incomplete / stub / planned topics are marked with **§**
## Default Topics

| Folder | Topic | Position |
| ----------------------- | :------------------------------------------------------------- | :------: |
| Introduction | [AboutAssertions][AboutAssertions] | 101 |
| Introduction | [AboutBooleans][AboutBooleans] | 102 |
| Introduction | [AboutNumbers][AboutNumbers] | 103 |
| Introduction | [AboutStrings][AboutStrings] | 104 |
| Introduction | [AboutCmdletVerbs][AboutCmdletVerbs] | 105 |
| Introduction | [AboutGetMember][AboutGetMember] | 106 |
| Introduction | [AboutBinary][AboutBinary] | 107 |
| Foundations | [AboutVariables][AboutVariables] | 111 |
| Foundations | [AboutAssignmentAndArithmetic][AboutAssignmentAndArithmetic] | 112 |
| Foundations | [AboutArrays][AboutArrays] | 113 |
| Foundations | [AboutComparison][AboutComparison] | 114 |
| Foundations | [AboutStringOperators][AboutStringOperators] | 115 |
| Foundations | [AboutConditionals][AboutConditionals] | 116 |
| Foundations | [AboutFunctionsAndScriptBlocks][AboutFunctionsAndScriptBlocks] | 117 |
| Foundations | [AboutOrderOfOperations][AboutOrderOfOperations] | 118 |
| Foundations | [AboutTypeOperators][AboutTypeOperators] | 119 |
| Foundations | [AboutHashtables][AboutHashtables] | 120 |
| Foundations | [AboutLoopsAndPipelines][AboutLoopsAndPipelines] | 121 |
| Katas | [ProcessingStrings][ProcessingStrings] | 150 |
| Katas | [SortingCharacters][SortingCharacters] | 151 |
| Cmdlets 1 | [AboutDiscovery][AboutDiscovery] | 201 |
| Cmdlets 1 | [AboutPSProviders][AboutPSProviders] | 202 |
| Cmdlets 1 | [AboutNewObject][AboutNewObject] | 204 |
| Cmdlets 1 | [AboutCompareObject][AboutCompareObject] | 205 |
| Cmdlets 1 | [AboutMeasureObject][AboutMeasureObject] | 206 |
| Cmdlets 1 | [AboutSelectObject][AboutSelectObject] | 206 |
| Cmdlets 1 | [AboutWhereObject][AboutWhereObject] | 207 |
| Cmdlets 1 | [AboutForEachObject][AboutForEachObject] | 208 |
| Cmdlets 1 | [AboutTeeObject][AboutTeeObject] | 209 |
| Cmdlets 1 | [AboutGroupObject][AboutGroupObject] | 210 |
| Cmdlets 1 | [AboutSortObject][AboutSortObject] | 211 |
| Cmdlets 1 | [AboutModules][AboutModules] | 212 |
| Constructs and Patterns | [AboutLists][AboutLists] | 301 |
| Constructs and Patterns | [AboutStringBuilder][AboutStringBuilder] | 302 |
| Constructs and Patterns | [AboutCustomObjects][AboutCustomObjects] | 303 |
| Constructs and Patterns | [AboutPSObjects][AboutPSObjects] | 304 |
| Constructs and Patterns | [AboutSplatting][AboutSplatting] | 305 |
| Constructs and Patterns | [**§** AboutAdvancedFunctions][AboutAdvancedFunctions] | 306 |
| Constructs and Patterns | [AboutRedirection][AboutRedirection] | 307 |
| Constructs and Patterns | [AboutErrorHandling][AboutErrorHandling] | 308 |
| Constructs and Patterns | [AboutBitwiseOperators][AboutBitwiseOperators] | 309 |
| Constructs and Patterns | [AboutEnumerations][AboutEnumerations] | 310 |
| Cmdlets 2 | [AboutOutCmdlets][AboutOutCmdlets] | 401 |

## Module Topics

### Dbatools

> TBD
<!-- Links for default koan topics -->

[AboutAssertions]: PSKoans/Koans/Introduction/AboutAssertions.Koans.ps1
[AboutBooleans]: PSKoans/Koans/Introduction/AboutBooleans.Koans.ps1
[AboutNumbers]: PSKoans/Koans/Introduction/AboutNumbers.Koans.ps1
[AboutStrings]: PSKoans/Koans/Introduction/AboutStrings.Koans.ps1
[AboutCmdletVerbs]: PSKoans/Koans/Introduction/AboutCmdletVerbs.Koans.ps1
[AboutGetMember]: PSKoans/Koans/Introduction/AboutGetMember.Koans.ps1
[AboutBinary]: PSKoans/Koans/Introduction/AboutBinary.Koans.ps1
[AboutVariables]: PSKoans/Koans/Foundations/AboutVariables.Koans.ps1
[AboutAssignmentAndArithmetic]: PSKoans/Koans/Foundations/AboutAssignmentAndArithmetic.Koans.ps1
[AboutArrays]: PSKoans/Koans/Foundations/AboutArrays.Koans.ps1
[AboutComparison]: PSKoans/Koans/Foundations/AboutComparison.Koans.ps1
[AboutStringOperators]: PSKoans/Koans/Foundations/AboutStringOperators.Koans.ps1
[AboutConditionals]: PSKoans/Koans/Foundations/AboutConditionals.Koans.ps1
[AboutFunctionsAndScriptBlocks]: PSKoans/Koans/Foundations/AboutFunctionsAndScriptBlocks.Koans.ps1
[AboutOrderOfOperations]: PSKoans/Koans/Foundations/AboutOrderOfOperations.Koans.ps1
[AboutTypeOperators]: PSKoans/Koans/Foundations/AboutTypeOperators.Koans.ps1
[AboutHashtables]: PSKoans/Koans/Foundations/AboutHashtables.Koans.ps1
[AboutLoopsAndPipelines]: PSKoans/Koans/Foundations/AboutLoopsAndPipelines.Koans.ps1
[ProcessingStrings]: PSKoans/Koans/Katas/ProcessingStrings.Koans.ps1
[SortingCharacters]: PSKoans/Koans/Katas/SortingCharacters.Koans.ps1
[AboutDiscovery]: PSKoans/Koans/Cmdlets%201/AboutDiscovery.Koans.ps1
[AboutPSProviders]: PSKoans/Koans/Cmdlets%201/AboutPSProviders.Koans.ps1
[AboutNewObject]: PSKoans/Koans/Cmdlets%201/AboutNewObject.Koans.ps1
[AboutCompareObject]: PSKoans/Koans/Cmdlets%201/AboutCompareObject.Koans.ps1
[AboutMeasureObject]: PSKoans/Koans/Cmdlets%201/AboutMeasureObject.Koans.ps1
[AboutSelectObject]: PSKoans/Koans/Cmdlets%201/AboutSelectObject.Koans.ps1
[AboutWhereObject]: PSKoans/Koans/Cmdlets%201/AboutWhereObject.Koans.ps1
[AboutForEachObject]: PSKoans/Koans/Cmdlets%201/AboutForEachObject.Koans.ps1
[AboutTeeObject]: PSKoans/Koans/Cmdlets%201/AboutTeeObject.Koans.ps1
[AboutGroupObject]: PSKoans/Koans/Cmdlets%201/AboutGroupObject.Koans.ps1
[AboutSortObject]: PSKoans/Koans/Cmdlets%201/AboutSortObject.Koans.ps1
[AboutModules]: PSKoans/Koans/Cmdlets%201/AboutModules.Koans.ps1
[AboutLists]: PSKoans/Koans/Constructs%20and%20Patterns/AboutLists.Koans.ps1
[AboutStringBuilder]: PSKoans/Koans/Constructs%20and%20Patterns/AboutStringBuilder.Koans.ps1
[AboutCustomObjects]: PSKoans/Koans/Constructs%20and%20Patterns/AboutCustomObjects.Koans.ps1
[AboutPSObjects]: PSKoans/Koans/Constructs%20and%20Patterns/AboutPSObjects.Koans.ps1
[AboutSplatting]: PSKoans/Koans/Constructs%20and%20Patterns/AboutSplatting.Koans.ps1
[AboutAdvancedFunctions]: PSKoans/Koans/Constructs%20and%20Patterns/AboutAdvancedFunctions.Koans.ps1
[AboutRedirection]: PSKoans/Koans/Constructs%20and%20Patterns/AboutRedirection.Koans.ps1
[AboutErrorHandling]: PSKoans/Koans/Constructs%20and%20Patterns/AboutErrorHandling.Koans.ps1
[AboutBitwiseOperators]: PSKoans/Koans/Constructs%20and%20Patterns/AboutBitwiseOperators.Koans.ps1
[AboutEnumerations]: PSKoans/Koans/Constructs%20and%20Patterns/AboutEnumerations.Koans.ps1
[AboutOutCmdlets]: PSKoans/Koans/Cmdlets%202/AboutOutCmdlets.Koans.ps1

<!-- Add links for koans from other modules below this line -->
2 changes: 1 addition & 1 deletion PSKoans/Koans/Foundations/AboutConditionals.Koans.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using module PSKoans
[Koan(Position = 120)]
[Koan(Position = 116)]
param()
<#
Conditionals and Branching
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using module PSKoans
[Koan(Position = 121)]
[Koan(Position = 117)]
param()
<#
Functions & Script Blocks (I)
Expand Down
2 changes: 1 addition & 1 deletion PSKoans/Koans/Foundations/AboutHashtables.Koans.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using module PSKoans
[Koan(Position = 130)]
[Koan(Position = 120)]
param()
<#
Hashtables
Expand Down
2 changes: 1 addition & 1 deletion PSKoans/Koans/Foundations/AboutLoopsAndPipelines.Koans.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using module PSKoans
[Koan(Position = 131)]
[Koan(Position = 121)]
param()
<#
The Pipeline & Loops
Expand Down
2 changes: 1 addition & 1 deletion PSKoans/Koans/Foundations/AboutOrderOfOperations.Koans.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using module PSKoans
[Koan(Position = 122)]
[Koan(Position = 118)]
param()
<#
Order of Operations
Expand Down
2 changes: 1 addition & 1 deletion PSKoans/Koans/Foundations/AboutTypeOperators.Koans.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using module PSKoans
[Koan(Position = 129)]
[Koan(Position = 119)]
param()
<#
Type Operators
Expand Down
22 changes: 11 additions & 11 deletions PSKoans/Koans/Introduction/AboutBinary.Koans.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using module PSKoans
[Koan(Position = 109)]
[Koan(Position = 107)]
param()
<#
Binary
Expand All @@ -14,18 +14,18 @@ param()
the knowledge is applicable to networking, programming, data science, databases, and essentially every
other area of computing.
What is represents is a base 2 number.
What is represents is a base 2 number.
For example, the below binary represents a "byte" of data, which contains 8 "bits".
Each bit will be either 1 or 0, as mentioned earlier.
So:
2^7 | 2^6 | 2^5 | 2^4 | 2^3 | 2^2 | 2^1 | 2^0
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1
-----+-----+-----+-----+-----+-----+-----+-----
0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 1
Or:
00000001
Expand Down Expand Up @@ -58,13 +58,13 @@ Describe "Binary conversion" {
<#
Convert the following binary representations into integers
#>

# Replace __ with the decimal value of 1111
# E.G. __ becomes 1234
$Binary = "1111"
$Value = __
$Value | Should -Be ([Convert]::ToInt32($Binary, 2))

# Replace __ with the decimal value of 1000
$Binary = "1000"
$Value = __
Expand Down Expand Up @@ -107,13 +107,13 @@ Describe "Binary conversion" {
<#
Convert the following integers into their binary representation
#>

# Replace __ with the binary value of 7
# E.G. "__" becomes "0100"
$Binary = "__"
$Value = 7
$Value | Should -Be ([Convert]::ToInt32($Binary, 2))

# Replace __ with the binary value of 12
$Binary = "__"
$Value = 12
Expand All @@ -129,12 +129,12 @@ Describe "Binary conversion" {
$Value = 7
$Value | Should -Be ([Convert]::ToInt32($Binary, 2))

# Replace __ with the binary value of 103
# Replace __ with the binary value of 103
# E.G. "__" becomes "01001110"
$Binary = "__"
$Value = 103
$Value | Should -Be ([Convert]::ToInt32($Binary, 2))

# Replace __ with the binary value of 250
$Binary = "__"
$Value = 250
Expand Down
44 changes: 24 additions & 20 deletions PSKoans/Koans/Introduction/AboutBooleans.Koans.ps1
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
using module PSKoans
[Koan(Position = 108)]
[Koan(Position = 102)]
param()
<#
Booleans
Booleans in PowerShell are either True or False, 1 or 0, on or off.
They allow us to represent a logical, binary, state of being.
Booleans in PowerShell are either True or False, 1 or 0, on or off.
They allow us to represent a logical, binary, state of being.
"Can I stop this service?" The answer is yes or no.
Therefore, the CanStop property for a System.ServiceProcess.ServiceController object
is a Boolean, shorthanded to bool. As the only possible respone we expect to the question
"Can i stop this service?" is a yes or no answer.
is a Boolean, abbreviated to bool. In other words, the only possible responses we have
to the question, "Can I stop this service?" are either "yes" or "no".
Check for yourself by running the following code:
Expand All @@ -21,30 +21,34 @@ param()
CanStop Property bool CanStop {get;}
There are two possible values for a boolean: $true or $false
There are only two possible values for a boolean: $true and $false
#>

Describe "Booleans" {
<#
Using only booleans, so $True or $False, answer the following questions

#>
It "True or False" {
# Using only booleans, so either $true or $false, fill in the blanks below.

# Replace the blanks with $true or $false
$____ | Should -Be (1 -gt 2) -Because '1 is not greater than 2'
It '( 1 -gt 2 ) is either true or false' {
$____ | Should -Be ( 1 -gt 2 ) -Because '1 is not greater than 2'
}

$____ | Should -Be (1 -lt 2) -Because "1 is greater than two"
It '( 1 -lt 2 ) is either true or false' {
$____ | Should -Be ( 1 -lt 2 ) -Because '1 is less than 2'
}

$____ | Should -Be (10 -lt 20) -Because "10 is less than 20"
It '( 10 -lt 20 ) is either true or false' {
$____ | Should -Be ( 10 -lt 20 ) -Because '10 is less than 20'
}

$____ | Should -Be (10 -gt 20) -Because "10 is less than 20"

$____ | Should -Be (3 -eq 3) -Because "3 is equal to 3"
It '( 10 -gt 20 ) is either true or false' {
$____ | Should -Be ( 10 -gt 20 ) -Because 'The lesser is not greater'
}

$____ | Should -Be (100 -lt 1) -Because "100 is less than one"
It '( 3 -eq 3 ) is either true or false' {
$____ | Should -Be ( 3 -eq 3 ) -Because 'A mirror reflects true'
}

It '( 100 -lt 1 ) is either true or false' {
$____ | Should -Be ( 100 -lt 1 ) -Because '100 is not less than 1'
}
}
25 changes: 12 additions & 13 deletions PSKoans/Koans/Introduction/AboutNumbers.Koans.ps1
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
using module PSKoans
[Koan(Position = 110)]
[Koan(Position = 103)]
param()
<#
Numbers
In PowerShell, we can use many different data types to represent numbers. All differ slightly in
In PowerShell, we can use many different data types to represent numbers. All differ slightly in
what they can and can't do. The two most common ones are:
Integers
Represent whole numbers. This is the default numeric data type that PowerShell uses
for whole numbers
Represent whole numbers. This is the default numeric data type that PowerShell uses
for whole numbers
Doubles
Represents numbers with decimal places or exponent. This is the default numeric type that PowerShell
will use for numbers entered with decimal places or exponents, for example: 0.5 or 2e3
Represents numbers with decimal places or exponent. This is the default numeric type that PowerShell
will use for numbers entered with decimal places or exponents, for example: 0.5 or 2e3
So 10 will be an integer and 10.0 will be a double. The examples below display some of the differences
inherent to the numeric types.
So 10 will be an integer and 10.0 will be a double. The examples below display some of the differences
inherent to the numeric types.
#>

Describe 'Basic Number Types' {
Expand All @@ -44,13 +43,13 @@ Describe 'Basic Number Types' {

$Pi = [Math]::PI
function Get-Number() {
param([parameter(mandatory=$true)][Int]$Int)
param([parameter(mandatory = $true)][Int]$Int)
$Int
}

'System.____' | Should -be $Pi.GetType().Fullname
# What number will return if you pass Pi into an int function?
___ -eq (Get-Number -Int $Pi) | Should -BeTrue
___ | Should -Be (Get-Number -Int $Pi)
}
}
}
Expand All @@ -65,6 +64,6 @@ Describe "Banker's Rounding" {
____ | Should -Be ([Int32]10.61)
____ | Should -Be ([Int32]12.7)
____ | Should -Be ([Int32]5.5)
}

}
}
2 changes: 1 addition & 1 deletion PSKoans/Koans/Introduction/AboutStrings.Koans.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using module PSKoans
[Koan(Position = 107)]
[Koan(Position = 104)]
param()
<#
Strings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[Koan(Position = 150)]
param()
<#
Apply Your Knowledge!
Kata: Processing Strings
Below is a list containing comma separated data about Microsoft's stock prices
during March of 2012. Without modifying the list, programatically find the day
Expand Down

0 comments on commit 41ea730

Please sign in to comment.