docToolchain
: docToolchain
docToolchain |
This solution is written in JavaScript.
The solution is quite straight forward. Much simpler than the groovy version.
#!/usr/bin/env node
const fs = require('fs')
const content = fs.readFileSync('./input.txt', 'utf8')
console.log(`Hello ${content}`)
This solution is written in Groovy.
I will use my helper to read the input from a file:
String readInput(fileName) {
new File(fileName).text
}
The solutions shall print out a greeting.
I will wrap this in a simple helloWorld
method.
String helloWorld() {
def whoShallBeGreeted = readInput("input.txt") (1)
"Hello ${whoShallBeGreeted}"
}
println "Solution: " + helloWorld()
1 | this is where I call the helper method to read my input |
There is no second star.