12
4
Challenge
The challenge is simple: print a snake.
You will get the length of the snake as input.
A snake of length 2 looks like this:
==(:)-
A snake of length 7 looks like this:
=======(:)-
In other words, the length of a snake is how many equal signs are before the head.
Usage
Let's say I made a C++ implementation and compiled it to ./getsnake
.
I could run it like so:
$ ./getsnake 10
==========(:)-
Clarifications
- Standard loopholes are disallowed.
- You can get input and output in any acceptable way.
- You can assume all inputs given are positive integers.
- You may write a function instead of a regular program.
8It's kinda useless to leave a challenge in the Sandbox for only half an hour. You did get some feedback, but it's usually best to leave it in the Sandbox for 24-72 hours. (Also, you should either flesh out the "Origins" part or remove it.) – El'endia Starman – 2016-07-31T20:15:36.520
Is a function enough or do you want a full program? – betseg – 2016-07-31T20:17:12.483
@betseg function is enough – InitializeSahib – 2016-07-31T20:17:57.140
What if the input is 0? – Fatalize – 2016-07-31T22:10:41.317
@Fatalize Or
NaN
,Infinity
, any negative number, or a blank string? – haykam – 2016-08-01T01:57:50.023@Fatalize the program will only ever get positive integers – InitializeSahib – 2016-08-01T05:31:03.413
@Peanut the program will only ever get positive integers – InitializeSahib – 2016-08-01T05:31:12.540
4
I'm afraid all My Squiggly Lamp answers are effortlessly portable to this.
– manatwork – 2016-08-01T12:49:46.330Is zero positive? – haykam – 2016-08-01T22:58:48.720
@Peanut no, it isn't – InitializeSahib – 2016-08-01T23:15:03.250
3Negative integers should cause the snake to swallow itself. – GuitarPicker – 2016-08-02T12:35:36.187
Are functions that return a string (rather than printing it) valid? – Jordan – 2016-08-02T15:19:54.620
Is hardcoding the input (i.e. you have to replace "n" with the number in the program to run it) allowed, rather than taking input through stdin or equivalent? – Theo – 2016-08-06T15:31:50.833
@T.Lukin it isn't – InitializeSahib – 2016-08-06T19:29:35.367