Login Register






Code Golf Challenge filter_list
Author
Message
Code Golf Challenge #1
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!

Reply

RE: Code Golf Challenge #2
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.

Reply

RE: Code Golf Challenge #3
(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.

Reply

RE: Code Golf Challenge #4
(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.

Reply

RE: Code Golf Challenge #5
Cool. Count me in.

Reply

RE: Code Golf Challenge #6
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.

Reply

RE: Code Golf Challenge #7
The current lead is completing the challenge in 50 characters. (:

Reply

RE: Code Golf Challenge #8
Pretty sure I did it in 48 chars, so let's see how that goes.

Reply

RE: Code Golf Challenge #9
(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

Reply

RE: Code Golf Challenge #10
My code is 39 chars ;-;

Reply