Skip to content

Commit

Permalink
exercise stubs - part 4 of 4
Browse files Browse the repository at this point in the history
[no important files changed]
  • Loading branch information
keiravillekode committed Oct 2, 2024
1 parent 2cdd441 commit a782bf3
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
29 changes: 29 additions & 0 deletions exercises/practice/circular-buffer/source/circular_buffer.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
module circular;

class Buffer(ElementType)
{
public:
this(size_t capacity)
{
// implement this function
}

ElementType pop()
{
// implement this function
}

void push(ElementType element)
{
// implement this function
}

void clear()
{
// implement this function
}

void forcePush(ElementType element)
{
// implement this function
}
}

unittest
{
import std.exception : assertThrown;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
module run_length_encoding;

pure string encode(immutable string input)
{
// implement this function
}

pure string decode(immutable string input)
{
// implement this function
}

unittest
{
immutable int allTestsEnabled = 0;
Expand Down
5 changes: 5 additions & 0 deletions exercises/practice/sum-of-multiples/source/sum_of_multiples.d
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
module sum_of_multiples;

pure int calculateSum(immutable int[] factors, immutable int limit)
{
// implement this function
}

unittest
{
immutable int allTestsEnabled = 0;
Expand Down

0 comments on commit a782bf3

Please sign in to comment.