221V 14 hours ago
parent
commit
70391632c4
1 changed files with 22 additions and 21 deletions
  1. 22 21
      exercises/062_loop_expressions.zig

+ 22 - 21
exercises/062_loop_expressions.zig

@@ -33,25 +33,26 @@
 //
 //
 const print = @import("std").debug.print;
 const print = @import("std").debug.print;
 
 
-pub fn main() void {
-    const langs: [6][]const u8 = .{
-        "Erlang",
-        "Algol",
-        "C",
-        "OCaml",
-        "Zig",
-        "Prolog",
-    };
-
-    // Let's find the first language with a three-letter name and
-    // return it from the for loop.
-    const current_lang: ?[]const u8 = for (langs) |lang| {
-        if (lang.len == 3) break lang;
-    };
-
-    if (current_lang) |cl| {
-        print("Current language: {s}\n", .{cl});
-    } else {
-        print("Did not find a three-letter language name. :-(\n", .{});
-    }
+pub fn main() void{
+  const langs: [6][]const u8 = .{
+    "Erlang",
+    "Algol",
+    "C",
+    "OCaml",
+    "Zig",
+    "Prolog",
+  };
+  
+  // Let's find the first language with a three-letter name and
+  // return it from the for loop.
+  const current_lang: ?[]const u8 = for (langs) |lang|{
+    if(lang.len == 3){ break lang; }
+  }else null;
+  
+  if(current_lang) |cl|{
+    print("Current language: {s}\n", .{cl});
+  }else{
+    print("Did not find a three-letter language name. :-(\n", .{});
+  }
 }
 }
+