Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Input-loop/V-(Vlang)/input-loop.v
Normal file
16
Task/Input-loop/V-(Vlang)/input-loop.v
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import os
|
||||
|
||||
fn main() {
|
||||
mut ay_view_content := []string{}
|
||||
file := "./input.txt"
|
||||
// check if file exists
|
||||
if os.is_file(file) == false {
|
||||
print("Error: '${file}' not found")
|
||||
exit(-1)
|
||||
}
|
||||
ay_view_content << os.read_lines(file) or {print(err) exit(-2)}
|
||||
for line in ay_view_content {
|
||||
if line !="" {println(line)}
|
||||
if line =="" {println("Found blank line!")}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue