Skip to content

Commit

Permalink
Rename concept exercises (#1464)
Browse files Browse the repository at this point in the history
* Rename booleans -> annalyns_infiltration

* Add lasagna blurb

* Rename comments -> weather forecast

* Rename conditionals -> blackjack

* Rename constants -> savings-account

* Renamee errors -> deep-thought

* Fix depe-thought's blurb

* Rename maps -> gross-store

* Fix chessboard's prerequisites

* Rename structs -> need-for-speed

* Rename methods -> elons-toys

* Fix some package names to follow conventions

Co-authored-by: Eric Kingery <[email protected]>

* Fix remaining package names with underscores

* Rename numbers -> car-factory

* Fix gross-store config

* Put active concept exercises in "beta"

* Rename slices -> card-tricks

* Rename strings -> party-robot

* Rename strings-package -> logs-logs-logs

* Rename time -> booking-up-for-beauty

* Rename zero-values -> zero, zilch, nada

* Fix booking-up-for-beauty config

* Fix booking_up_for_beauty forked from

* Rename car-factory -> cars-asemble

* Update exercises/concept/cars-assemble/.docs/introduction.md

Co-authored-by: Eric Kingery <[email protected]>

* Update exercises/concept/cars-assemble/.meta/design.md

Co-authored-by: Eric Kingery <[email protected]>

Co-authored-by: Eric Kingery <[email protected]>
  • Loading branch information
angelikatyborska and ekingery authored Jul 5, 2021
1 parent 5017fdd commit 92eb8bc
Show file tree
Hide file tree
Showing 140 changed files with 485 additions and 208 deletions.
3 changes: 0 additions & 3 deletions concepts/strings-package/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,3 @@ For example, you can get a `byte` at position `i` from a `string` called `s` wit
With that said, string types are immutable so operations like s[i] = 'a' are not available and will result in a compilation error.

[Strings, bytes, runes and characters in Go](https://blog.golang.org/strings) provides a deep dive into this topic.

This exercise also introduces _conditionals_. Here is a little intro:
[Go by Example: If/Else](https://gobyexample.com/if-else)
286 changes: 280 additions & 6 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,179 @@
"basics"
],
"prerequisites": [],
"status": "active"
"status": "beta"
},
{
"slug": "annalyns-infiltration",
"name": "Annalyn's Infiltration",
"uuid": "8833b0c0-1008-4426-8225-1dc2b4852d52",
"concepts": [
"booleans"
],
"prerequisites": [
"basics"
],
"status": "beta"
},
{
"slug": "party-robot",
"name": "Party Robot",
"uuid": "b3594c44-1a68-489d-a446-16369247c84c",
"concepts": [
"strings"
],
"prerequisites": [
"basics"
],
"status": "beta"
},
{
"slug": "weather-forecast",
"name": "Weather Forecast",
"uuid": "63415c33-658e-4722-bd81-0b80060aecc9",
"concepts": [
"comments"
],
"prerequisites": [
"basics"
],
"status": "wip"
},
{
"slug": "savings-account",
"name": "Savings Account",
"uuid": "13f6b5ab-f4bb-453a-a6a9-50132a1d4885",
"concepts": [
"constants"
],
"prerequisites": [
"basics",
"comments",
"strings"
],
"status": "beta"
},
{
"slug": "blackjack",
"name": "Blackjack",
"uuid": "628308fc-34e9-46ae-9661-9e0ebceeef34",
"concepts": [
"conditionals-if",
"conditionals-switch"
],
"prerequisites": [
"booleans",
"strings",
"numbers"
],
"status": "beta"
},
{
"slug": "booking-up-for-beauty",
"name": "Booking up for Beauty",
"uuid": "57ae07c8-8d7a-4f16-bd25-81a9646dac39",
"concepts": [
"time"
],
"prerequisites": [
"basics",
"strings",
"numbers"
],
"status": "beta"
},
{
"slug": "cars-assemble",
"name": "Cars Assemble",
"uuid": "7ab1692d-b7e8-4f11-9bbd-2b855501e5ce",
"concepts": [
"numbers",
"type-conversion"
],
"prerequisites": [
"constants",
"conditionals-if"
],
"status": "beta"
},
{
"slug": "gross-store",
"name": "Gross Store",
"uuid": "fb70cf92-fd2c-453b-896c-21a957cfb093",
"concepts": [
"maps"
],
"prerequisites": [
"basics",
"conditionals-if",
"numbers"
],
"status": "beta"
},
{
"name": "Need For Speed",
"slug": "need-for-speed",
"uuid": "b165c8b4-429f-4e9f-b157-a636d22b217f",
"concepts": [
"structs"
],
"prerequisites": [
"conditionals-if",
"numbers"
],
"status": "beta"
},
{
"name": "Elon's Toys",
"slug": "elons-toys",
"uuid": "18fb2aa2-9748-481e-a321-6b6844c1deb6",
"concepts": [
"methods"
],
"prerequisites": [
"structs",
"pointers"
],
"status": "beta"
},
{
"slug": "deep-thought",
"name": "Deep Thought",
"uuid": "097176e2-5024-44e7-ab86-9bc0ec245347",
"concepts": [
"errors"
],
"prerequisites": [
"constants",
"types"
],
"status": "wip"
},
{
"name": "Card Tricks",
"slug": "card-tricks",
"uuid": "154660c2-db8c-4ec1-91f2-6b1275eabbc0",
"concepts": [
"slices"
],
"prerequisites": [
"numbers",
"conditionals-if",
"iteration"
],
"status": "beta"
},
{
"name": "Logs, Logs, Logs!",
"slug": "logs-logs-logs",
"uuid": "81230a7c-4e47-4a4d-a004-14eae32ec914",
"concepts": [
"strings-package"
],
"prerequisites": [
"slices"
],
"status": "beta"
},
{
"name": "Chessboard",
Expand All @@ -53,13 +225,25 @@
"range-iteration"
],
"prerequisites": [
"basics",
"conditionals",
"functions",
"conditionals-if",
"maps",
"slices"
"slices",
"iteration"
],
"status": "beta"
},
{
"name": "Zero, Zilch, Nada",
"slug": "zero-zilch-nada",
"uuid": "fa4735f8-4d8a-4fb1-85ed-9cf03e9f7b7a",
"concepts": [
"nil",
"zero-values"
],
"prerequisites": [
"types"
],
"status": "active"
"status": "beta"
}
],
"practice": [
Expand Down Expand Up @@ -1571,6 +1755,96 @@
"name": "Basics",
"slug": "basics",
"uuid": "5d2b4677-1850-4ee4-890d-dc55a1654626"
},
{
"name": "Booleans",
"slug": "booleans",
"uuid": "e3942921-34ec-41eb-a999-a5d85a6623fd"
},
{
"name": "Comments",
"slug": "comments",
"uuid": "9ee93eab-b413-442c-b7fb-76bf044eea2d"
},
{
"name": "Conditionals If",
"slug": "conditionals-if",
"uuid": "b3731323-f5bb-4b38-931c-2d734667bf8d"
},
{
"name": "Conditionals Switch",
"slug": "conditionals-switch",
"uuid": "6a4103e0-e7a9-427e-b1bd-716870580c45"
},
{
"name": "Constants",
"slug": "constants",
"uuid": "b56f68de-44ef-4bd4-8b14-2c50b2a366dd"
},
{
"name": "Errors",
"slug": "errors",
"uuid": "a960da78-c940-4725-8069-929f42564cdb"
},
{
"name": "Iteration",
"slug": "iteration",
"uuid": "e18ca160-bbb8-4cd0-882a-0e67f1e60b47"
},
{
"name": "Maps",
"slug": "maps",
"uuid": "625aa065-b006-4fc5-b276-28e048376b46"
},
{
"name": "Methods",
"slug": "methods",
"uuid": "d25c6e6b-c6d4-40ce-80f9-cecbc5a72254"
},
{
"name": "Nil",
"slug": "nil",
"uuid": "c4d16fac-3e46-41ac-adf8-ce8f3f73f745"
},
{
"name": "Numbers",
"slug": "numbers",
"uuid": "82cff17e-88cd-4707-a6d7-b5143251f029"
},
{
"name": "Slices",
"slug": "slices",
"uuid": "23e1c40a-300c-4a44-bc32-f3440a057216"
},
{
"name": "Strings",
"slug": "strings",
"uuid": "eeae05c6-b751-44a2-b843-517ec7b83ef7"
},
{
"name": "Strings Package",
"slug": "strings-package",
"uuid": "33708451-a03f-44ce-be05-eaacc1d5793c"
},
{
"name": "Structs",
"slug": "structs",
"uuid": "5bd431cf-c30d-4f5c-a16d-c62e51720fbd"
},
{
"name": "Time",
"slug": "time",
"uuid": "4673000c-7822-4252-88c5-723f47d6ad06"
},
{
"name": "Type Conversion",
"slug": "type-conversion",
"uuid": "4f3d535e-cec8-4303-ac5a-ed91a53bd594"
},
{
"name": "Zero Values",
"slug": "zero-values",
"uuid": "a50b4ed6-6198-4ab2-8075-3770900db4c9"
}
],
"key_features": [
Expand Down
File renamed without changes.
20 changes: 20 additions & 0 deletions exercises/concept/annalyns-infiltration/.meta/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"blurb": "Learn about booleans by helping Annalyn free her best friend.",
"authors": [
"oanaOM"
],
"forked_from": [
"csharp/annalyns-infiltration"
],
"files": {
"solution": [
"annalyns_infiltration.go"
],
"test": [
"annalyns_infiltration_test.go"
],
"exemplar": [
".meta/exemplar.go"
]
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package booleans
package annalyn

// CanFastAttack can be executed only when the knight is sleeping
func CanFastAttack(knightIsAwake bool) bool {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package booleans
package annalyn

// CanFastAttack can be executed only when the knight is sleeping
func CanFastAttack(knightIsAwake bool) bool {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package booleans
package annalyn

import "testing"

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Introduction

## Conditionals If

## Conditionals Switch

## Booleans
Conditionals in Go are similar to conditionals in other languages. The underlying type of any conditional operation is the `bool` type, which can have the value of `true` or `false`. Conditionals are often used as flow control mechanisms to check for various conditions.

Go supports the three logical operators `&&` (AND), `||` (OR), and `!` (NOT).
## Conditionals If

Conditionals in Go are similar to conditionals in other languages. The underlying type of any conditional operation is the `bool` type, which can have the value of `true` or `false`. Conditionals are often used as flow control mechanisms to check for various conditions. For checking a particular case an `if` statement can be used, which executes its code if the underlying condition is `true` like this:
For checking a particular case an `if` statement can be used, which executes its code if the underlying condition is `true` like this:

```go
var value string
Expand All @@ -30,6 +26,8 @@ if value == "val" {
}
```

## Conditionals Switch

Go also provides a `switch` statement for more advanced scenarios.

```go
Expand Down
Loading

0 comments on commit 92eb8bc

Please sign in to comment.