jarv / cmdchallenge

This repo is mirror of https://gitlab.com/jarv/cmdchallenge
https://about.cmdchallenge.com
MIT License
721 stars 71 forks source link

print_number_sequence alternative solution #144

Closed fibo closed 7 years ago

fibo commented 7 years ago

Summary

Steps to reproduce

https://cmdchallenge.com/#/print_number_sequence

I expected that seq 1 100 | tr '\n' ' ' would be a solution, it produces the same output as the example echo $(seq 1 100)

mtak commented 7 years ago

It seems the problem is that tr '\n' ' ' also cuts off the last newline character. The challenge doesn't specify you should preserve this newline though.

jarv commented 7 years ago

Yeah, the newline at the end is significant which is the case for all of the challenges, maybe we can improve the wording.

fibo commented 7 years ago

Ah ok, thank you I missed it. The output of both commands looked almost the same and also I could not immagine the right solution.