Simplified parse.
This commit is contained in:
@@ -25,11 +25,10 @@ func NewCalculator(parser *io.Cliargs) Calculator {
|
||||
}
|
||||
|
||||
func (o Calculator) Collatz() {
|
||||
err := o.parser.Parse()
|
||||
number, err := o.parser.Parse()
|
||||
if err != nil {
|
||||
log.Panicf("Couldn't parse input: %s\n", err)
|
||||
}
|
||||
number := o.parser.GetNumber()
|
||||
fmt.Print(number.Text(10))
|
||||
o.nextNumber(number)
|
||||
fmt.Println()
|
||||
|
||||
Reference in New Issue
Block a user