Add solutions

This commit is contained in:
Laurens Miers 2024-09-25 15:26:17 +02:00
parent 7417f01d5d
commit b056b6ad81
96 changed files with 229 additions and 166 deletions

View file

@ -123,8 +123,8 @@ fn isADuck(possible_duck: anytype) bool {
// Please make sure MyType has both waddle() and quack()
// methods:
const MyType = @TypeOf(possible_duck);
const walks_like_duck = ???;
const quacks_like_duck = ???;
const walks_like_duck = @hasDecl(MyType, "waddle");
const quacks_like_duck = @hasDecl(MyType, "quack");
const is_duck = walks_like_duck and quacks_like_duck;