-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
exercises: stubs: resolve unused parameter errors (#195)
Before this commit, when testing an unchanged exercise stub: $ zig test test_leap.zig leap.zig:1:19: error: unused function parameter pub fn isLeapYear(year: u32) bool { ^~~~ With this commit: $ zig test test_leap.zig Test [1/9] test.year not divisible by 4 in common year... thread 123456 panic: please implement the isLeapYear function /foo/exercism-tracks/zig/exercises/practice/leap/leap.zig:3:5: 0x201234 in isLeapYear (test) @Panic("please implement the isLeapYear function"); [...] Closes: #175
- Loading branch information
Showing
15 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
// Take a look at the tests, you might have to change the function arguments | ||
|
||
pub fn binarySearch(target: usize, buffer: ?[]const usize) SearchError!usize { | ||
_ = target; | ||
_ = buffer; | ||
@panic("please implement the binarySearch function"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub fn steps(number: isize) anyerror!usize { | ||
_ = number; | ||
@panic("please implement the steps function"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
exercises/practice/difference-of-squares/difference_of_squares.zig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
pub fn squareOfSum(number: isize) isize { | ||
_ = number; | ||
@panic("compute the sum of i from 0 to n then square it"); | ||
} | ||
|
||
pub fn sumOfSquares(number: isize) isize { | ||
_ = number; | ||
@panic("compute the sum of i^2 from 0 to n"); | ||
} | ||
|
||
pub fn differenceOfSquares(number: isize) isize { | ||
_ = number; | ||
@panic("compute the difference between the square of sum and sum of squares"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub fn square(index: isize) ChessboardError!u64 { | ||
_ = index; | ||
@panic("please implement the square function"); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pub fn compute(first: []const u8, second: []const u8) DnaError!usize { | ||
_ = first; | ||
_ = second; | ||
@panic("please implement the compute function"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub fn isIsogram(str: []const u8) bool { | ||
_ = str; | ||
@panic("please implement the isIsogram function"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub fn isLeapYear(year: u32) bool { | ||
_ = year; | ||
@panic("please implement the isLeapYear function"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub fn isPangram(str: []const u8) bool { | ||
_ = str; | ||
@panic("please implement the isPangram function"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pub fn recite(allocator: mem.Allocator, words: []const []const u8) (fmt.AllocPrintError || mem.Allocator.Error)![][]u8 { | ||
_ = allocator; | ||
_ = words; | ||
@panic("please implement the recite function"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
// Import the appropriate standard library and modules | ||
|
||
pub fn toRna(allocator: mem.Allocator, dna: []const u8) (RnaError || mem.Allocator.Error)![]const u8 { | ||
_ = allocator; | ||
_ = dna; | ||
@panic("please implement the toRna function"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pub fn calculateHandshake(allocator: mem.Allocator, number: isize) mem.Allocator.Error![]const Signal { | ||
_ = allocator; | ||
_ = number; | ||
@panic("please implement the calculateHandshake function"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
pub fn twoFer(buffer: []u8, name: ?[]const u8) anyerror![]u8 { | ||
_ = buffer; | ||
_ = name; | ||
@panic("respond with the appropriate message given a particular name"); | ||
} |