mirror of
https://codeberg.org/ziglings/exercises.git
synced 2025-06-08 10:07:01 +09:00
fixing grammar and typos
This commit is contained in:
parent
9ce4a7d6f0
commit
63a6557d40
3 changed files with 10 additions and 9 deletions
|
@ -1,4 +1,5 @@
|
|||
//
|
||||
// WARNING: AS OF Zig 0.13.x Async is no longer supported.
|
||||
// Until further notice skip to #092_interfaces.zig
|
||||
// Six Facts:
|
||||
//
|
||||
// 1. The memory space allocated to your program for the
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
// Until now, we've only been printing our output in the console,
|
||||
// which is good enough for fighting alien and hermit bookkeeping.
|
||||
//
|
||||
// However, many other task require some interaction with the file system,
|
||||
// However, many other tasks require some interaction with the file system,
|
||||
// which is the underlying structure for organizing files on your computer.
|
||||
//
|
||||
// The File System provide a hierarchical structure for storing files
|
||||
// by organizing files into directories, which hold files and other directories,
|
||||
// thus creating a tree structure for navigating.
|
||||
// thus creating a tree-like structure for navigating.
|
||||
//
|
||||
// Fortunately, zig standard library provide a simple api for interacting
|
||||
// with the file system, see the detail documentation here
|
||||
// Fortunately, the zig standard library provides a simple API for interacting
|
||||
// with the file system, to learn more, see the detailed documentation here
|
||||
//
|
||||
// https://ziglang.org/documentation/master/std/#std.fs
|
||||
//
|
||||
|
@ -29,7 +29,7 @@ pub fn main() !void {
|
|||
// then we'll try to make a new directory /output/
|
||||
// to put our output files.
|
||||
cwd.makeDir("output") catch |e| switch (e) {
|
||||
// there are chance you might want to run this
|
||||
// there is a chance you might want to run this
|
||||
// program more than once and the path might already
|
||||
// been created, so we'll have to handle this error
|
||||
// by doing nothing
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
// with content `It's zigling time!`(18 byte total)
|
||||
//
|
||||
// Now there no point in writing to a file if we don't read from it am I right?
|
||||
// let's wrote a program to read the content of the file that we just created.
|
||||
// let's write a program to read the contents of the file we just created.
|
||||
//
|
||||
// I am assuming you've created the appropriate files for this to work.
|
||||
//
|
||||
|
@ -37,10 +37,10 @@ pub fn main() !void {
|
|||
// this should print out : `AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`
|
||||
std.debug.print("{s}\n", .{content});
|
||||
|
||||
// okay, seem like threat of violence is not the answer in this case
|
||||
// okay, seems like threats of violence are not the answer in this case
|
||||
// can you go here to find a way to read the content ?
|
||||
// https://ziglang.org/documentation/master/std/#std.fs.File
|
||||
// hint: you might find two answer that are both vaild in this case
|
||||
// hint: you might find two answers that are both vaild in this case
|
||||
const byte_read = zig_read_the_file_or_i_will_fight_you(&content);
|
||||
|
||||
// Woah, too screamy, I know you're excited for zigling time but tone it down a bit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue