Skip to content

Commit d39e9ee

Browse files
Merge branch 'main' into add-resistor-color-duo
2 parents 53b8a8e + cb76145 commit d39e9ee

File tree

191 files changed

+4368
-3591
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+4368
-3591
lines changed

.github/workflows/auto-rebase.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
99
runs-on: ubuntu-22.04
1010
steps:
11-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
11+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
1212
- name: Automatic Rebase
1313
uses: cirrus-actions/rebase@b87d48154a87a85666003575337e27b8cd65f691
1414
env:

.github/workflows/exercise-tests.yml

+11-8
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,19 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
julia-version: ["1.6", "1", nightly]
26-
os: [ubuntu-22.04, windows-2022, macOS-latest]
26+
os: [ubuntu-22.04, windows-2022, macos-14]
27+
exclude:
28+
- julia-version: 1.6
29+
os: macos-14
2730

2831
steps:
29-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
32+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
3033

31-
- uses: julia-actions/setup-julia@f40c4b69330df1d22e7590c12e76dc2f9c66e0bc
34+
- uses: julia-actions/setup-julia@f2258781c657ad9b4b88072c5eeaf9ec8c370874
3235
with:
3336
version: ${{ matrix.julia-version }}
3437

35-
- uses: julia-actions/cache@569d290d51d6c22c1cd4ceec591a1bf112aab9c0
38+
- uses: julia-actions/cache@d48542bb7b6239a9391789f01d21a6bdde9ad5df
3639

3740
- name: Install test dependencies
3841
run: julia --color=yes --project -e "using Pkg; Pkg.instantiate()"
@@ -45,20 +48,20 @@ jobs:
4548
runs-on: ubuntu-22.04
4649

4750
steps:
48-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
51+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
4952

5053
- name: Pull julia-test-runner image
5154
run: docker pull exercism/julia-test-runner
5255

5356
- name: Install Julia dependencies
5457
run: julia --color=yes --project -e "using Pkg; Pkg.instantiate()"
55-
58+
5659
- name: Generate test reports using julia-test-runner
5760
id: generate-reports
5861
run: julia --color=yes --project runtestrunner.jl
59-
62+
6063
- name: Upload reports as artifact
61-
uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595
64+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
6265
with:
6366
name: test-reports
6467
path: ${{ steps.generate-reports.outputs.results-path }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: No important files changed
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
branches: [main]
7+
paths:
8+
- "exercises/concept/**"
9+
- "exercises/practice/**"
10+
- "!exercises/*/*/.approaches/**"
11+
- "!exercises/*/*/.articles/**"
12+
- "!exercises/*/*/.docs/**"
13+
- "!exercises/*/*/.meta/**"
14+
15+
permissions:
16+
pull-requests: write
17+
18+
jobs:
19+
check:
20+
uses: exercism/github-actions/.github/workflows/check-no-important-files-changed.yml@main
21+
with:
22+
repository: ${{ github.event.pull_request.head.repo.owner.login }}/${{ github.event.pull_request.head.repo.name }}
23+
ref: ${{ github.head_ref }}

CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ This policy was initially adopted from the Front-end London Slack community and
9090
A version history can be seen on [GitHub](https://github.com/exercism/website-copy/edit/main/pages/code_of_conduct.md).
9191

9292
_This policy is a "living" document, and subject to refinement and expansion in the future.
93-
This policy applies to the Exercism website, the Exercism GitHub organization, any other Exercism-related communication channels (e.g. Slack, Twitter, email) and any other Exercism entity or event._
93+
This policy applies to the Exercism website, the Exercism GitHub organization, any other Exercism-related communication channels (e.g. Discord, Forum, Twitter, email) and any other Exercism entity or event._
9494

9595
## Addendum
9696

config.json

+25-1
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,14 @@
699699
"prerequisites": [],
700700
"difficulty": 2
701701
},
702+
{
703+
"slug": "resistor-color",
704+
"name": "Resistor Color",
705+
"uuid": "ef7e22db-1f66-4d44-87f9-23d97f794628",
706+
"practices": [],
707+
"prerequisites": [],
708+
"difficulty": 1
709+
},
702710
{
703711
"slug": "resistor-color-trio",
704712
"name": "Resistor Color Trio",
@@ -881,7 +889,23 @@
881889
"practices": [],
882890
"prerequisites": [],
883891
"difficulty": 2
884-
}
892+
},
893+
{
894+
"slug": "two-fer",
895+
"name": "Two-Fer",
896+
"uuid": "91a8a9c0-041c-4e2e-97fc-dae149ef69f9",
897+
"practices": [],
898+
"prerequisites": [],
899+
"difficulty": 1
900+
},
901+
{
902+
"slug": "connect",
903+
"name": "Connect",
904+
"uuid": "6cd9edb0-35ba-4f32-b51b-a734d98e3a88",
905+
"practices": [],
906+
"prerequisites": [],
907+
"difficulty": 5
908+
}
885909
]
886910
},
887911
"concepts": [

exercises/concept.wip/annalyns-infiltration/runtests.jl

+50-48
Original file line numberDiff line numberDiff line change
@@ -9,61 +9,63 @@ if VERSION < v"1.1"
99
@eval eachrow(A) = (view(A, i, :) for i in axes(A, 1))
1010
end
1111

12-
@testset "fast attack" begin
13-
@test !can_do_fast_attack(true)
14-
@test can_do_fast_attack(false)
15-
end
12+
@testset verbose = true "tests" begin
13+
@testset "fast attack" begin
14+
@test !can_do_fast_attack(true)
15+
@test can_do_fast_attack(false)
16+
end
1617

17-
@testset "spying" begin
18-
character_state_combinations = Bool[
19-
0 0 0 0;
20-
0 0 1 1;
21-
0 1 0 1;
22-
0 1 1 1;
23-
1 0 0 1;
24-
1 0 1 1;
25-
1 1 1 1;
26-
]
18+
@testset "spying" begin
19+
character_state_combinations = Bool[
20+
0 0 0 0;
21+
0 0 1 1;
22+
0 1 0 1;
23+
0 1 1 1;
24+
1 0 0 1;
25+
1 0 1 1;
26+
1 1 1 1;
27+
]
2728

28-
for state in eachrow(character_state_combinations)
29-
@test can_spy(state[1:3]...) == state[4]
29+
for state in eachrow(character_state_combinations)
30+
@test can_spy(state[1:3]...) == state[4]
31+
end
3032
end
31-
end
3233

33-
@testset "signaling prisoner" begin
34-
character_state_combinations = Bool[
35-
0 0 0;
36-
0 1 1;
37-
1 0 0;
38-
1 1 0;
39-
]
34+
@testset "signaling prisoner" begin
35+
character_state_combinations = Bool[
36+
0 0 0;
37+
0 1 1;
38+
1 0 0;
39+
1 1 0;
40+
]
4041

41-
for state in eachrow(character_state_combinations)
42-
@test can_signal_prisoner(state[1:2]...) == state[3]
42+
for state in eachrow(character_state_combinations)
43+
@test can_signal_prisoner(state[1:2]...) == state[3]
44+
end
4345
end
44-
end
4546

46-
@testset "freeing prisoner" begin
47-
character_state_combinations = Bool[
48-
0 0 0 0 0;
49-
0 0 0 1 1;
50-
0 0 1 0 1;
51-
0 0 1 1 1;
52-
0 1 0 0 0;
53-
0 1 0 1 0;
54-
0 1 1 0 0;
55-
0 1 1 1 0;
56-
1 0 0 0 0;
57-
1 0 0 1 1;
58-
1 0 1 0 0;
59-
1 0 1 1 1;
60-
1 1 0 0 0;
61-
1 1 0 1 0;
62-
1 1 1 0 0;
63-
1 1 1 1 0;
64-
]
47+
@testset "freeing prisoner" begin
48+
character_state_combinations = Bool[
49+
0 0 0 0 0;
50+
0 0 0 1 1;
51+
0 0 1 0 1;
52+
0 0 1 1 1;
53+
0 1 0 0 0;
54+
0 1 0 1 0;
55+
0 1 1 0 0;
56+
0 1 1 1 0;
57+
1 0 0 0 0;
58+
1 0 0 1 1;
59+
1 0 1 0 0;
60+
1 0 1 1 1;
61+
1 1 0 0 0;
62+
1 1 0 1 0;
63+
1 1 1 0 0;
64+
1 1 1 1 0;
65+
]
6566

66-
for state in eachrow(character_state_combinations)
67-
@test can_free_prisoner(state[1:4]...) == state[5]
67+
for state in eachrow(character_state_combinations)
68+
@test can_free_prisoner(state[1:4]...) == state[5]
69+
end
6870
end
6971
end

exercises/concept.wip/annalyns-infiltration2/runtests.jl

+14-12
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@ include("game.jl")
55
# This exercise isn't about mathematical methods to determine the distribution of a random sample,
66
# therefore we only test that all possible values are returned at least once.
77

8-
@testset "fog" begin
9-
@test Set(is_foggy() for _ in 1:1000) == Set([true, false])
10-
end
8+
@testset verbose = true "tests" begin
9+
@testset "fog" begin
10+
@test Set(is_foggy() for _ in 1:1000) == Set([true, false])
11+
end
1112

12-
@testset "distracted dog" begin
13-
@test Set(is_dog_distracted() for _ in 1:1000) == Set([true, false])
14-
end
13+
@testset "distracted dog" begin
14+
@test Set(is_dog_distracted() for _ in 1:1000) == Set([true, false])
15+
end
1516

16-
@testset "loot purse" begin
17-
@test Set(loot() for _ in 1:1000) == Set(3:13)
18-
end
17+
@testset "loot purse" begin
18+
@test Set(loot() for _ in 1:1000) == Set(3:13)
19+
end
1920

20-
@testset "loot crate" begin
21-
crate = Set(["Cabbage", "Daring Dagger", "Sneaky Shoes"])
22-
@test Set(loot(crate) for _ in 1:1000) == crate
21+
@testset "loot crate" begin
22+
crate = Set(["Cabbage", "Daring Dagger", "Sneaky Shoes"])
23+
@test Set(loot(crate) for _ in 1:1000) == crate
24+
end
2325
end

exercises/concept.wip/dnd-char/runtests.jl

+41-39
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,51 @@ using Test
22

33
include("dnd-character.jl")
44

5-
@testset "Randomly generated ability is within range" begin
6-
for i in 1:1000
7-
@test 3 <= ability() <= 18
5+
@testset verbose = true "tests" begin
6+
@testset "Randomly generated ability is within range" begin
7+
for i in 1:1000
8+
@test 3 <= ability() <= 18
9+
end
810
end
9-
end
10-
11-
@testset "Ability modifiers are integers" begin
12-
@test typeof(modifier(7)) <: Integer
13-
end
1411

15-
@testset "Ability modifiers" begin
16-
@test modifier(3) == -4
17-
@test modifier(4) == -3
18-
@test modifier(5) == -3
19-
@test modifier(6) == -2
20-
@test modifier(7) == -2
21-
@test modifier(8) == -1
22-
@test modifier(9) == -1
23-
@test modifier(10) == 0
24-
@test modifier(11) == 0
25-
@test modifier(12) == 1
26-
@test modifier(13) == 1
27-
@test modifier(14) == 2
28-
@test modifier(15) == 2
29-
@test modifier(16) == 3
30-
@test modifier(17) == 3
31-
@test modifier(18) == 4
32-
end
12+
@testset "Ability modifiers are integers" begin
13+
@test typeof(modifier(7)) <: Integer
14+
end
3315

34-
@testset "Randomly generated character is valid" begin
35-
# Helper method to check if all abilities of a character are within the expected ranges.
36-
function ischaracter(c)
37-
3 <= c.strength <= 18 &&
38-
3 <= c.dexterity <= 18 &&
39-
3 <= c.constitution <= 18 &&
40-
3 <= c.intelligence <= 18 &&
41-
3 <= c.wisdom <= 18 &&
42-
3 <= c.charisma <= 18 &&
43-
c.hitpoints == 10 + modifier(c.constitution)
16+
@testset "Ability modifiers" begin
17+
@test modifier(3) == -4
18+
@test modifier(4) == -3
19+
@test modifier(5) == -3
20+
@test modifier(6) == -2
21+
@test modifier(7) == -2
22+
@test modifier(8) == -1
23+
@test modifier(9) == -1
24+
@test modifier(10) == 0
25+
@test modifier(11) == 0
26+
@test modifier(12) == 1
27+
@test modifier(13) == 1
28+
@test modifier(14) == 2
29+
@test modifier(15) == 2
30+
@test modifier(16) == 3
31+
@test modifier(17) == 3
32+
@test modifier(18) == 4
4433
end
4534

46-
for i in 1:1000
47-
c = DNDCharacter()
48-
@test ischaracter(c)
35+
@testset "Randomly generated character is valid" begin
36+
# Helper method to check if all abilities of a character are within the expected ranges.
37+
function ischaracter(c)
38+
3 <= c.strength <= 18 &&
39+
3 <= c.dexterity <= 18 &&
40+
3 <= c.constitution <= 18 &&
41+
3 <= c.intelligence <= 18 &&
42+
3 <= c.wisdom <= 18 &&
43+
3 <= c.charisma <= 18 &&
44+
c.hitpoints == 10 + modifier(c.constitution)
45+
end
46+
47+
for i in 1:1000
48+
c = DNDCharacter()
49+
@test ischaracter(c)
50+
end
4951
end
5052
end

0 commit comments

Comments
 (0)