Sinisterly
Code Golf Challenge - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: Coding (https://sinister.ly/Forum-Coding--71)
+--- Thread: Code Golf Challenge (/Thread-Code-Golf-Challenge)

Pages: 1 2


Code Golf Challenge - Dijkstra - 09-15-2015

WINNER: @Neko with 30 characters

What is code golfing?
It's just like golfing. You have to complete the challenge using the least amount of characters and lines as possible!

What is the challenge?
Collatz Conjecture
Pick a positive integer n. If it is odd, multiply it by three and and then add one. Otherwise, divide it by two. The positive integer obtained is the new n, and this procedure is repeated. It is believed that n will eventually become 1.

You are to...
Write a program that takes in the value n and outputs the amount of times it must do this procedure to become 1.

FAQ
What language do we have to use?
Any. However, remember that Python would most likely beat a language like Java due to Java's required main function.

When will the competition end?
It will end a week from this date. September 22nd.

What will I get if I win?
If you are not a member of IO, you will get invited. However, if you are already a member, I will discuss your prize in a PM.



Good luck to all the competitors!


RE: Code Golf Challenge - Lain - 09-15-2015

I'll be sure to enter this when I wake up tomorrow.

Are there any limitations? Like, am I cheating if I use a language that can be written on one line? for example; JavaScript.


RE: Code Golf Challenge - Dijkstra - 09-15-2015

(09-15-2015, 04:02 PM)Neko Wrote: I'll be sure to enter this when I wake up tomorrow.

Are there any limitations? Like, am I cheating if I use a language that can be written on one line? for example; JavaScript.

No, you're thinking ahead of the game. Lol
However, everything has to be your code. You can't use a library.


RE: Code Golf Challenge - Lain - 09-15-2015

(09-15-2015, 04:04 PM)Dijkstra Wrote: No, you're thinking ahead of the game. Lol
However, everything has to be your code. You can't use a library.

Awesome, makes things a lot easier.


RE: Code Golf Challenge - $ninja - 09-16-2015

Cool. Count me in.


RE: Code Golf Challenge - Dijkstra - 09-16-2015

A note to everyone, please PM me your solution! I'll keep the thread updated with the character count thats in lead; however, you don't want to give away your code.


RE: Code Golf Challenge - Dijkstra - 09-17-2015

The current lead is completing the challenge in 50 characters. (:


RE: Code Golf Challenge - Meowie - 09-18-2015

Pretty sure I did it in 48 chars, so let's see how that goes.


RE: Code Golf Challenge - Dijkstra - 09-19-2015

(09-18-2015, 05:52 PM)Meowie Wrote: Pretty sure I did it in 48 chars, so let's see how that goes.

42 characters is the lead now. lol


RE: Code Golf Challenge - Meowie - 09-21-2015

My code is 39 chars ;-;