| Bytes | Lang | Time | Link |
|---|---|---|---|
| 021 | Vyxal 3 | 250606T115655Z | Themooni |
| 390 | Ruby rprime | 230909T002505Z | Value In |
| 083 | Itr | 230908T172115Z | bsoelch |
| 046 | Jelly | 161107T150038Z | Erik the |
| nan | NARS2000 APL | 151101T164942Z | Oberon |
| 759 | osascript | 151101T141758Z | Addison |
| 073 | CJam | 151101T002528Z | Dennis |
| 090 | Pyth | 151031T213426Z | lirtosia |
Vyxal 3, 21 bytes
Hello World, 2 bytes
kH
Factorial, 1 byte
!
Primes, 3 bytes
ɾ~℗
ɾ~℗
ɾ # range 1..implicit input
~ # filter by
℗ # is prime?
💎
Unique chars, 3 bytes
ʀu⅟
ʀu⅟
ʀ # to lowercase
u # uniques
⅟ # strip whitespace
💎
diamond, 12 bytes
-5 bytes by pacman256
4ƛ★×4«⨪]æᐕJ”
4ƛ★×4«⨪]æᐕJ”
4ƛ ] # map over 1..4
★× # "*" times n
4« # left-pad spaces to length 4
⨪ # palindromize
æᐕJ # duplicate reverse join
” # join on newlines
💎
Created with the help of Luminespire.
Ruby -rprime, 390 bytes
I don't know why I decided to try this.
-rprime flag loads the Prime library for task 3. As per the meta post on program flags, adding flags treats it as a "different language", so I can't add -n or -p for some tasks and remove it for others, even if it would save bytes. (Tasks 1 and 5 take no input, and no input means programs with those flags won't run, which is why they can't be used.)
Task 1, 47 bytes
Backslash-escaped almost every letter to free letters up for usage in later tasks. $> is an alias for STDOUT, which will be used later.
$><<"H\x65\154\154\x6f\54\40W\x6f\x72\154\x64!"
Task 2, 31 bytes
3+9+~9 == 2 to avoid reusing 2.
p((3+9+~9..gets.to_i).inject:*)
Task 3, 28 bytes + 56 (().ceis) = 84
Since this is the only task that doesn't say to take input from STDIN, this one is a lambda instead so I don't need to take a huge penalty from doing things with gets.to_i or something similar. This is probably the only time where lambda saves bytes over its stabby syntax ->, which has to buy back > and uses up the - needed in Task 4.
lambda{|e|Prime.each(e).sum}
Task 4, 67 bytes + 96 (*.<achinrstu) 71 bytes + 72 (*.<achrst) = 163 143
*.<achinrstu)This one had wayyyyyy too much overlap but it was needed to do the given task. Uses t,=*STDIN to get the line of input, assuming newlines won't be present. Let me know if that's an incorrect assumption.
t,=*STDIN;t=t.tr'A-Z','a-z';t=t.tr'^a-z','';t=t.chars;t&=t;STDOUT<<t*''
Task 5, 53 bytes + 32 ($*<>) = 85
Buys back virtually every character in the program, since it's still cheaper than any alternative I could think of. Uses heredoc syntax for the string since we no longer have ' or " and we're buying back < anyways since it's cheaper than buying back puts.
$><<<<Q
*
***
*****
*******
*****
***
*
Q
Itr, 83 bytes, no characters repeated between programs
The five programs separated by newlines:
"Olssv'^vysk("7-
P
µf«äµL1=×S
32|ÍÌM64á<F¥
» *
***
*****
*******
*****
***
*
The letters in problem 4 are printed in alphabetical order instead of the order they appear in, I did not find any rule against that
Explanation
"Olssv'^vysk("7- ; Hello World! shifted by 7 to avoid space
P ; product over the 1-based range to the input
µf«äµL1=×S
µf« ; replace the numbers in the range 1 : input with their prime-factorisation
äµL1=× ; only keep the elements with a length of one
S ; sum up the array
; assumes that the input consists of ASCII letters and white-spaces
32|ÍÌM64á<F¥
32| ; or with 32 -> converts uppercase ascii to lowercase
ÍÌ ; get a list of all unique elements
M64á<F¥ ; print the elements that are larger that 64 (filters out white spaces)
M ; for all elements
64á< ; is the the number greater than 64
F ; repeat that many times
¥ ; print
; string-literal containing the required output
; all possibilities to loop are used up by the previous answers
» *
***
*****
*******
*****
***
*
Jelly, 46 bytes (non-competing)
“3ḅaė;œ»
Ɠ!
ÆRS
ɠQḲŒl
4Ḷ¤‘+¤ṖṚṭ×”*Fµ4Ḷṭ4ḶṚṖ¤F×⁶+⁸Y
Try it online! (Copy/paste each snippet)
Apparently, the restriction did not restrict golfing :) Just suggestions for the last one, of course, please.
NARS2000 APL, 144 bytes (85 characters)
Task 1, 21 bytes (17 characters)
⎕←"Hello, World!"
Task 2, 10 bytes (4 characters)
⎕←!⎕
Task 3, 22 bytes (11 characters)
⎕←+/¯2π⍳2π⎕
Task 4, 53 bytes (29 characters)
⎕←∪Q[26∣Q⍸⍞∩Q←⎕AV[97+⍳26]∪⎕A]
Task 5, 38 bytes (24 characters)
⎕←" *"[1+4<∘.+⍨(⍳3),⊖⍳4]
osascript, 759 Bytes
I knew this was going to be a lot when I started. o-o
Task 1: 15 Bytes
"Hello, World!"
I knew that it was going to be bad from this point.
Task 2: 64 + 8*4 = 96 Bytes
on run a set o to 1 repeat a set o to a*o set a to a-1 end o end
Oh gawd.
Task 3: 170 + 8*13 = 274 Bytes
on run a set o to 0 set t to false repeat with i from 2 to a set t to true repeat with c from 2 to i-1 if i mod c=0 then set t to false end if t then set o to o+i end end
Dennis ≠ outgolfed.
Task 4: 225 + 8*13 = 329
on run a set o to"" repeat with i in items of a repeat with c in characters of i if c is not in o then if ASCII number of c<91 then set o to o&(ASCII character of(ASCII number of c+32)) else set o to o&c end end end end o end
...
Task 5: 45 Bytes
" * *** ***** ******* ***** *** *"
So, yeah. I knew I was gonna lose from the start. But it was interesting, I'd be interested to know if there's a way to do this in fewer characters. Character map (as provided by Dennis):
de h l o r w 15
a cdef hi lmnop rstu w 160
a de nop rstu 57
abcdef hi lmnop rstu w 214
39
0
The character count above is slightly off - newlines made it have issues, as the newlines were uncounted.
NOTE: The reason for not using stuff like a's characters or the like is that the ' character has to be used when executing from the osascript command line. If I had used ', I'd have to use \' or something similar, which wouldn't have helped me at all. Also, it only recognizes " as string capturers, so I was kinda screwed there as well. But that was fun.
CJam, 73 bytes
"Obkkh+'Phukc&"7f^
q~m!
ri){'j3+_3++~},:+
lS-el_&
4{_' *4@-Y*('**+}%_1>W%\+N*
Each line is a full program. Try them online: 1 | 2 | 3 | 4 | 5
Letter map
bc f h k op u 18
m q 4
ij r 17
e l s 7
n w y 27
If you want (and each of your programs fits in a line), you can use this CJam program to create a letter map for your own submission.
Pyth, 90 bytes
First attempt...
Task 1: 20 bytes
+"Hello, "+C87"orld!
Task 2, 3 bytes
.!Q
Task 3, 9 bytes
sf}TPTSvz
Task 4, 6+8=14 bytes
@G{rw0
Task 5, 44 bytes
" *
***
*****
*******
*****
***
*