mirror of
https://codeberg.org/ziglings/exercises.git
synced 2026-07-28 18:25:16 +00:00
Compare commits
6 Commits
151450cc7d
...
a463aafb91
| Author | SHA1 | Date | |
|---|---|---|---|
| a463aafb91 | |||
| 11868112c5 | |||
| d52661fd39 | |||
| fe1c9fb9bd | |||
| 935d268280 | |||
| dce9c803bf |
@@ -47,7 +47,7 @@ const Narcissus = struct {
|
|||||||
myself: *Narcissus = undefined,
|
myself: *Narcissus = undefined,
|
||||||
echo: void = undefined, // Alas, poor Echo!
|
echo: void = undefined, // Alas, poor Echo!
|
||||||
|
|
||||||
fn fetchTheMostBeautifulType() type {
|
fn FetchTheMostBeautifulType() type {
|
||||||
return @This();
|
return @This();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -70,7 +70,7 @@ pub fn main() void {
|
|||||||
//
|
//
|
||||||
// The fix for this is very subtle, but it makes a big
|
// The fix for this is very subtle, but it makes a big
|
||||||
// difference!
|
// difference!
|
||||||
const Type2 = narcissus.fetchTheMostBeautifulType();
|
const Type2 = narcissus.FetchTheMostBeautifulType();
|
||||||
|
|
||||||
// Now we print a pithy statement about Narcissus.
|
// Now we print a pithy statement about Narcissus.
|
||||||
print("A {s} loves all {s}es. ", .{
|
print("A {s} loves all {s}es. ", .{
|
||||||
|
|||||||
@@ -74,9 +74,9 @@ pub fn main() !void {
|
|||||||
// before the parallel processing begins.
|
// before the parallel processing begins.
|
||||||
std.debug.print("Starting work...\n", .{});
|
std.debug.print("Starting work...\n", .{});
|
||||||
|
|
||||||
// These curly brackets are very important, they are necessary
|
// These curly braces are very important, they are necessary
|
||||||
// to enclose the area where the threads are called.
|
// to enclose the area where the threads are called.
|
||||||
// Without these brackets, the program would not wait for the
|
// Without these braces, the program would not wait for the
|
||||||
// end of the threads and they would continue to run beyond the
|
// end of the threads and they would continue to run beyond the
|
||||||
// end of the program.
|
// end of the program.
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
//
|
//
|
||||||
// The fix for this is very subtle, but it makes a big
|
// The fix for this is very subtle, but it makes a big
|
||||||
// difference!
|
// difference!
|
||||||
- const Type2 = narcissus.fetchTheMostBeautifulType();
|
- const Type2 = narcissus.FetchTheMostBeautifulType();
|
||||||
+ const Type2 = Narcissus.fetchTheMostBeautifulType();
|
+ const Type2 = Narcissus.FetchTheMostBeautifulType();
|
||||||
|
|
||||||
// Now we print a pithy statement about Narcissus.
|
// Now we print a pithy statement about Narcissus.
|
||||||
print("A {s} loves all {s}es. ", .{
|
print("A {s} loves all {s}es. ", .{
|
||||||
|
|||||||
Reference in New Issue
Block a user