From dc646413a39e0cd92ca88deb30243abb8a67d1dc Mon Sep 17 00:00:00 2001 From: depial <91621102+depial@users.noreply.github.com> Date: Thu, 19 Sep 2024 19:05:01 -0400 Subject: [PATCH] Delete exercises/concept.wip/leap directory Deletes the superfluous concept exercise Leap which overlaps with the practice exercise on the website. --- exercises/concept.wip/leap/.docs/hints.md | 22 ---------- .../concept.wip/leap/.docs/instructions.md | 23 ---------- .../concept.wip/leap/.docs/introduction.md | 43 ------------------- exercises/concept.wip/leap/.docs/source.md | 4 -- exercises/concept.wip/leap/.meta/config.json | 21 --------- exercises/concept.wip/leap/.meta/design.md | 11 ----- exercises/concept.wip/leap/.meta/exemplar.jl | 6 --- exercises/concept.wip/leap/leap.jl | 0 exercises/concept.wip/leap/runtests.jl | 41 ------------------ 9 files changed, 171 deletions(-) delete mode 100644 exercises/concept.wip/leap/.docs/hints.md delete mode 100644 exercises/concept.wip/leap/.docs/instructions.md delete mode 100644 exercises/concept.wip/leap/.docs/introduction.md delete mode 100644 exercises/concept.wip/leap/.docs/source.md delete mode 100644 exercises/concept.wip/leap/.meta/config.json delete mode 100644 exercises/concept.wip/leap/.meta/design.md delete mode 100644 exercises/concept.wip/leap/.meta/exemplar.jl delete mode 100644 exercises/concept.wip/leap/leap.jl delete mode 100644 exercises/concept.wip/leap/runtests.jl diff --git a/exercises/concept.wip/leap/.docs/hints.md b/exercises/concept.wip/leap/.docs/hints.md deleted file mode 100644 index 0c4b1c89..00000000 --- a/exercises/concept.wip/leap/.docs/hints.md +++ /dev/null @@ -1,22 +0,0 @@ -# Hints - -## 2. Write a boolean expression that describes whether a given year `y` is a leap year - -- Consider writing a [truth table](https://en.wikipedia.org/wiki/Truth_table) for this exercise and see if you can work out what the simplest predicates are and how they could be combined with `&&` and `||`. A predicate is a statement or a function that is either true or false, depending on its inputs. `isodd(number)` is an example of a predicate function in Julia. - -## 3. Wrap it in the `isleapyear` function - -- You can return a boolean expression directly: - - ```julia - julia> function equalstwo(x) - return x == 2 - end - equalstwo (generic function with 1 method) - - julia> equalstwo(3) - false - - julia> equalstwo(2) - true - ``` diff --git a/exercises/concept.wip/leap/.docs/instructions.md b/exercises/concept.wip/leap/.docs/instructions.md deleted file mode 100644 index 7e0b64f8..00000000 --- a/exercises/concept.wip/leap/.docs/instructions.md +++ /dev/null @@ -1,23 +0,0 @@ -# Instructions - -A leap year in the Gregorian calendar occurs - -- on every year that is evenly divisible by 4, -- except every year that is evenly divisible by 100, -- unless the year is also evenly divisible by 400. - -For example, 1997 is not a leap year, but 1996 is. 1900 is not a leap -year, but 2000 is. - -## 1. Write boolean expressions to determine divisibility for the rules given above - -## 2. Combine these expressions to a single boolean expression that describes whether a given year `y` is a leap year - - - -## 3. Wrap it in the `isleapyear` function - -```julia-repl -julia> isleapyear(2000) -true -``` diff --git a/exercises/concept.wip/leap/.docs/introduction.md b/exercises/concept.wip/leap/.docs/introduction.md deleted file mode 100644 index 69435860..00000000 --- a/exercises/concept.wip/leap/.docs/introduction.md +++ /dev/null @@ -1,43 +0,0 @@ -# Introduction - -Given a year, report if it is a leap year in the Gregorian calendar. - -## Arithmetic Operators: Remainder & Equality - -Julia provides a number of [arithmetic operators](https://en.wikipedia.org/wiki/Arithmetic#Arithmetic_operations) for numeric types[^1]. - -In this exercise you will only need the `%` operator that calculates the [remainder](https://en.wikipedia.org/wiki/Remainder) of the division of two numbers - -```julia-repl -julia> 10 % 5 -0 - -julia> 8 % 5 -3 -``` - -and the equality operator `==` - -```julia-repl -julia> 2 + 2 == 4 -true - -julia> 2 + 2 == 5 -false -``` - -~~~~exercism/note -It is conventional to have one space either side of each operator: - -```julia -x % y == 3 -``` - -instead of - -```julia -x%y==3 -``` -~~~~ - -[^1]: You can find a list of them in the [Julia Manual](https://docs.julialang.org/en/v1/manual/mathematical-operations/#Arithmetic-Operators). diff --git a/exercises/concept.wip/leap/.docs/source.md b/exercises/concept.wip/leap/.docs/source.md deleted file mode 100644 index 941fd9c8..00000000 --- a/exercises/concept.wip/leap/.docs/source.md +++ /dev/null @@ -1,4 +0,0 @@ -# Source - -- C. Caine, Exercism Mentoring Notes on `leap` exercise, GitHub. (n.d.). https://github.com/exercism/website-copy/blob/ede72a420a96906360cb3aeed0ba51c4692723cc/tracks/julia/exercises/leap/mentoring.md (accessed October 28, 2020). -- Exercism Problem Specification for `leap` exercise, GitHub. (n.d.). https://github.com/exercism/problem-specifications/tree/42dd0cea20498fd544b152c4e2c0a419bb7e266a/exercises/leap (accessed October 28, 2020). diff --git a/exercises/concept.wip/leap/.meta/config.json b/exercises/concept.wip/leap/.meta/config.json deleted file mode 100644 index f5cb7841..00000000 --- a/exercises/concept.wip/leap/.meta/config.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "blurb": "Learn about arithmetic operators and boolean expressions by searching for leap years.", - "language_versions": "≥1.0", - "files": { - "exemplar": [ - ".meta/exemplar.jl" - ], - "test": [ - "runtests.jl" - ], - "solution": [ - "leap.jl" - ] - }, - "contributors": [], - "authors": [ - "SaschaMann", - "cmcaine" - ], - "forked_from": ["v2/leap"] -} diff --git a/exercises/concept.wip/leap/.meta/design.md b/exercises/concept.wip/leap/.meta/design.md deleted file mode 100644 index 0f2c465e..00000000 --- a/exercises/concept.wip/leap/.meta/design.md +++ /dev/null @@ -1,11 +0,0 @@ -# Design - -## Goal - -The goal of this exercise is to teach the student the fundamentals of the boolean expressions and (arithmetic) operators in Julia. -This is a prerequisite for them to understand how unit testing works in Julia, which will be required later in the track. - -## Learning objectives - -- Know how to use arithmetic operators, in particular the remainder operator. -- Know how to compare two integers for equality. diff --git a/exercises/concept.wip/leap/.meta/exemplar.jl b/exercises/concept.wip/leap/.meta/exemplar.jl deleted file mode 100644 index c5625fb8..00000000 --- a/exercises/concept.wip/leap/.meta/exemplar.jl +++ /dev/null @@ -1,6 +0,0 @@ -""" - is_leap_year(year) - -Return if `year` is a leap year in the gregorian calendar. -""" -isleapyear(y) = (y % 4 == 0) && ((y % 100 != 0) || (y % 400 == 0)) diff --git a/exercises/concept.wip/leap/leap.jl b/exercises/concept.wip/leap/leap.jl deleted file mode 100644 index e69de29b..00000000 diff --git a/exercises/concept.wip/leap/runtests.jl b/exercises/concept.wip/leap/runtests.jl deleted file mode 100644 index 513137ef..00000000 --- a/exercises/concept.wip/leap/runtests.jl +++ /dev/null @@ -1,41 +0,0 @@ -using Test - -include("leap.jl") - -@testset verbose = true "tests" begin - @testset "year not divisible by 4 in common year" begin - @test !isleapyear(2015) - end - - @testset "year divisible by 2, not divisible by 4 in common year" begin - @test !isleapyear(1970) - end - - @testset "year divisible by 4, not divisible by 100 in leap year" begin - @test isleapyear(1996) - end - - @testset "year divisible by 4 and 5 is still a leap year" begin - @test isleapyear(1960) - end - - @testset "year divisible by 100, not divisible by 400 in common year" begin - @test !isleapyear(2100) - end - - @testset "year divisible by 100 but not by 3 is still not a leap year" begin - @test !isleapyear(1900) - end - - @testset "year divisible by 400 in leap year" begin - @test isleapyear(2000) - end - - @testset "year divisible by 400 but not by 125 is still a leap year" begin - @test isleapyear(2400) - end - - @testset "year divisible by 200, not divisible by 400 in common year" begin - @test !isleapyear(1800) - end -end