challenges

my solutions to various "programming challenge" problems
git clone https://wehaveforgeathome.hates.computer/challenges.git
Log | Files | Refs | LICENSE

013.io (248B)


      1 #!/usr/local/bin/io
      2 # expects to be run from dir containing sample.txt
      3 
      4 sum := 0
      5 
      6 f := File with("sample.txt")
      7 f openForReading
      8 f readLines foreach(v, line,
      9   num := line asNumber
     10   sum = sum + num
     11 )
     12 f close
     13 
     14 sum asString(10) exSlice(0,10) println