12
1
You're challenge is to write 5 different full programs for the 5 following tasks:
Print
Hello, World!
Given an input with STDIN, output the factorial, you can assume that the input is an integer >= 0
Given an integer N, calculate the sum of the primes <= N
Given an input with STDIN, output the letters used in the input. For example: the input is
Hello world
, you need to outputhelowrd
. Note that the output is in lowercase. You can assume that the input is always alphabetic with whitespaces, the whitespaces are ignored.Output the following diamond exactly like this:
* *** ***** ******* ***** *** *
All these challenges are probably very easy, but there is a catch. Every letter you use cannot be used again in the other programs. This is not prohibited, but will give you a penalty of +8 bytes. For example, if this is your program for the first task:
print("Hello, World!");
Then you cannot use the following letters (in uppercase or lowercase form): p
, r
, i
, n
, t
, h
, e
, l
, o
, w
, d
in the other programs. If you do have to use them, you can 'buy' each letter for 8 bytes. So if you want to use the letter l
again in another program, you get a penalty of 8 bytes. After you have paid the penalty, you can use each letter as much as you want in this program. Other characters don't matter. Also, all 5 programs should be in the same language.
This is code-golf, so least amount of bytes wins!
3This is a slightly different spin on challenges we've already had, but not different enough for it to not to be a multi-dupe in my eyes. – Mego – 2015-10-31T21:08:55.710
Does 8 bytes permit you to use a given letter as much as you like in the next program? – trichoplax – 2015-10-31T21:24:21.923
3@Mego I'd vote to close this as a multi-duplicate without the restriction, but the restriction makes it a whole new game. – trichoplax – 2015-10-31T21:25:02.200
1If you use a given letter in 3 programs, do you pay the 8 byte penalty twice (16 bytes)? – trichoplax – 2015-10-31T21:26:20.370
1@trichoplax, yes you pay 16 bytes – Adnan – 2015-10-31T21:28:29.643
1@trichoplax Hardly. The existing solutions for the duped problems will still be competitive. The top solutions here will just be the concatenation of the duped questions' solutions, with a higher score from the penalty. – Mego – 2015-10-31T21:47:04.143
1In TI-BASIC, there are tokens that display using certain letters (for example,
sin(
displays likesin(
. However, they are not stored in memory that way (its token code is C2). Can we repeat the letters displayed without penalty? – lirtosiast – 2015-11-01T00:11:09.150Are we allowed to have trailing spaces on the lines of Task 5? – lirtosiast – 2015-11-01T06:31:54.033
@ThomasKwa, the displayed letters don't matter, only the code matters. Also, trailing whitespaces are not allowed in task 5. – Adnan – 2015-11-01T10:20:47.890
@Mego although the existing solutions will be competitive at first, I would expect variations tailored to the new restriction to win eventually. I can't tell in advance though. – trichoplax – 2015-11-01T14:51:36.480
There just aren't enough versions of
Print
... – LegionMammal978 – 2015-11-07T21:47:04.300