49

Funciton, 1222 bytes Apart from numeric literals, there are two ways I can produce a value (any value at all) in Funciton: stdin and lambda expressions. Stdin is a single box while a full lambda expression requires more syntax, so I’m going with stdin. However, while stdin could be anything, all of the following work regardless of what input is provided. ...


28

CJam, 8 9 tasks in 140 bytes First off, here is a script you can use to sort your solutions and tell you which ones will fit into the tweet: {\s\Se[oSo}:F; qN/ee{W=,}${)_,_T+:T140>X*_{0:X;}*'=@11+*N+*o\~)YF_,ZFTZFoNo}/ Just paste your 12 solutions into the input, one on each line. Run it here. The first column is the task number, the second its size (...


25

JavaScript, 144 141 140 138 132 125 123 bytes With help from @edc65, @Sjoerd Job Postmus, @DocMax, @usandfriends, @Charlie Wynn and @Mwr247! result.textContent = [ +[] ,// 0 (3 bytes) -~[] ,// 1 (4 bytes) -~-~[] ,// 2 (6 bytes) -~-~-~[] ,// 3 (8 bytes) ...


19

Pyth, 9 tasks in 138 bytes This took quite a while. I think 9 tasks is the limit for Pyth. Including the next shortest program (Sator Square) results in 160 bytes. Golfing 20 bytes is quite unlikely. There are 2 or 3 tasks which are a little bit ugly and maybe can be shortened, but overall I'm quite pleased with the solutions. Task 1 - Can Three Numbers ...


17

Huzzah, first to complete all the tasks! \o/ Task 1, Perl, 32 bytes $_=eval join"+",map$_**3,0..$_-1 +1 byte for the -p flag. Commentary: Perl is weird. Task 2, CJam, 14 bytes {_mp\)2mL_i=&} My first CJam program! Task 3, GolfScript, 8 bytes ~$.,(2/= Eval STDIN input, sort, take length, decrement, divide by two, then take the item of the sorted ...


17

Mouse-2002, 27 26 17 14 bytes The first snippets push 0-10, and ZR+ pushes 25 then 17 and 25 17 + 42 = is 1. A B C D E F G H I J K ZR+


15

Task 1, 3var, 14 13 bytes '><k*>#aa/>sp (Esolang wiki page for 3var) ' R = n > A = n <k B = n-1 * R = A*B = n(n-1) > A = n(n-1) #aa B = 2 / R = A/B = n(n-1)/2 >s A = (n(n-1)/2)^2 p ...


15

CJam, 27 24 bytes U e# 0 X e# 1 Y e# 2 Z e# 3 Z) e# 3 + 1 YZ+ e# 2 + 3 ZZ+ e# 3 + 3 AZ- e# 10 - 3 YZ# e# 2³ A( e# 10 - 1 A e# 10 EZ* e# 14 × 3 Thanks to @MartinBüttner for -1 byte! Try it online!


15

Hexagony, 13 bytes 1 2 3 4 5 6 7 8 9 10 42 Try it online! In Hexagony, 0 through 9 are functions that multiply the current memory by 10, and then add the number represented by the function name. Therefore, the first snippet is empty as memories start off as 0. For example, if the current memory is 65, executing the function 3 will make the current memory ...


13

Task 1, CJam, 7 bytes q~,:+_* I just wanted to get the (presumably) optimal CJam solution for this in. It makes use of the fact that the sum of the first n cubes is the square of the nth triangular number, which is itself the sum of the first n integers. Test it here. Task 4, Fission, 173 88 78 69 68 bytes GitHub repository for Fission. /@\O/S@+>\ ^...


13

Brachylog, 50 46 bytes {Ċ∧Lċ₂l∧Lgj:?z{tT∧?h~cṪhlI∧ṪbhTl:I+-₁:I↔}ᵐ:L} Try it online! Decompress: ~{Ċ∧Lċ₂l∧Lgj:?z{tT∧?h~cṪhlI∧ṪbhTl:I+-₁:I↔}ᵐ:L} Try it online! Saved 5 bytes thanks to @ais523 Explanation The good side of declarative languages is that we can reuse the same code for both compressing and decompressing. As such, the code for compress is ...


12

Score: 382 * 1.12 = 462 Languages prone to change. 1. APL, 8 4 Thanks @marinus for shaving 4 chars off. f←⍴~ Called with the strings as the left and right arguments, eg. 'foobarbaz' f 'ao' 5 2. Ruby, 35 31 Thanks @DoorknobofSnow for shaving 4 chars off. f=->s,r{s.gsub(/(?<=^)/,r+' ')} 3. Python, 48 f=lambda s,n,b:s.replace(*['\t',' '*n]...


12

Perl 5, 86 75 71 66 bytes All ^Fs are literal control characters (0x06 in ASCII), and hence a single byte. $[ # array start index, defaults to 0 2 !$[ # !0 is 1 3 $^F # max sys file descriptor number, 2 on all sane systems 2 ++$^F ...


12

Brainfuck, 70 bytes + ++ +++ ++++ +++++ ++++++ +++++++ ++++++++ +++++++++ ++++++++++ --[>+<++++++]>- Each line must be run individually. The first 10 are self explanatory: we increment the value of the cell via each plus. The 42 is a lot more complex. It relies on the fact the most brainfuck interpreter use 8-bit cells, meaning that all ...


12

Darkness, 339 303 bytes This is where Darkness really shines. Get it? :~)! Without printing (replaced the space with \s in the first line since it won't show otherwise): \s █ ██ ███ ████ █████ ██████ ███████ ████████ █████████ ██████████ ██████████████████████████████████████████ With printing: ■ █■ ██■ ███■ ████■ █████■ ...


12

Python, 88 87 bytes lambda n:[a for a in range(11*n)if any(a%b<1for b in range(2,a))][:3*n:3]#1,,,=====bd++ lambda n:[[a*b for b in range(1,n+1)]for a in range(1,n+1)]#,,::ybaaa(*i%n< =====2)d33f f=lambda n,a=1,b=1:a<n and f(n,b,a+b)or n==a#2eerrrfo::((**iii11[[aannn+ ]]y))%33gg f=lambda n,a=1:a<=n and a**a+f(n,a+1)#::ooeeiii]] y))bbbgg,...


12

Jelly, 19 18 17 characters Task 1 Ḟþe*S ×5µḊḟÆRm3ḣ³ Try it online! Task 2 5µḊḟÆRm3ḣ³Ḟe*S ×þ Try it online! Task 3 5µḊḟmḣþ*S ×3RÆḞ³e Try it online! Task 4 ×5ḊḟÆm3ḣ³þe Rµ*ḞS Try it online! How it works Every line in a Jelly program defines a separate link (function). The last one is the main link and is called automatically when the program is ...


11

Score: 4651 2907 + 60% penalty 1. GolfScript - 14 characters {*}:a;lligator Usage: c n a e.g. "test" 3 a -> testtesttest Happy Gilmoore 2. Python - 72 characters def f(t,s,n,p=-1): while n:p=t.find(s,p+1);n-=1 if p+1 else n return p 3. Javascript - 255 characters /* Curry for Dinner f(x:function, y: function) -> g Where g is a function that ...


10

Eh, I'll start out with a couple I guess. First time golfing. Task 1, Python, 38 21 bytes lambda n:(n*n-n)**2/4 Sum a list of all the cubes up to x. Changed expression thanks to xnor Task 2, TI-Basic 89, 244 bytes Func If iPart(log(x+1)/log(2))=log(x+1)/log(2) Then Return log(x+1)/log(2) Else Return 0 EndIf EndFunc Func If isPrime(x)=false Return 0 ...


10

Pyth, 9 tasks in 136 bytes Task 1: 7 bytes <-F_SQ0 Demonstration Sort in descending order (_SQ), fold subtraction over them (a-b-c), check if the result is negative. Task 2: 14 bytes sho.a-sN^T6.pz Demonstration Form all string permutations (.pz), sort them (o) based on the absolute value of the difference (.a-) between the number (sN) and one ...


10

Prolog, 113 99 bytes Snippets: e-e % 0.0 e/e % 1.0 e/e+e/e % 2.0 ceil(e) % 3 ceil(pi) % 4 ceil(e*e-e) % 5 ceil(e+e) % 6 floor(e*e) % 7 ceil(e*e) % 8 ceil(pi*e) % 9 ceil(pi*pi) % 10 ceil(e^e*e) % 42 Combines the mathematical constants e and pi in different ways ...


10

MATL, 30 bytes O l H I K Kl+ HI* KYq HK* IH^ K:s IH^:sI- H, I, and K are predefined constants for 2, 3, and 4 (like pi). O and l are functions that returns a matrix of zeros (O) or ones (l), the default size is 1x1. : makes a vector, and s sums it, so K:s makes a vector from 1 to 4 and sums it to get 10. Yq is the n-th prime function, so KYq is the 4th ...


9

First thing: task 6 technically does NOT count; I uploaded unc under an hour ago. However, I almost uploaded it this morning, but decided to write a test suite first. Idiot. So, anyway, here goes! Note that most unc things are intentionally backwards, so && really means || and such, which is why some operations look weird (e.g. using - to calculate ...


9

TI-BASIC, 11 12 Tasks in 728 830 bytes Task 1 in 7 bytes :2max(Ans)`<`sum(Ans Input is a list in Ans. Task 2 in 92 110 bytes :seq(expr(sub(Ans,I,1)),I,1,7→L₁ :SortA(L₁ :min(7,1+sum(not(L₁ :{L₁(1)+sum(seq(L₁(I))₁₀^(I-8),I,2,7)),L₁(Ans)+sum(seq((I`>`Ans)L₁(I)₁₀^(1-I),I,2,7 :ᴇ6Ans(1+(0`>`min(ΔList(abs(1-Ans Prompts for a list of digits Input is a ...


9

CJam, 162 25 bytes • qi),0Xt_ff{*s4Se]}N*s0'xt 12 bytes • q_:i:mh\,mq/ (© Dennis) 18 bytes • q~P*90/ms\_**9.81/ 12 bytes • q$e`{0=~}$e~ (© Dennis) 16 bytes • 1_{_2$+}99*]qi#) 22 bytes • qS/(1+1$s{1$#Lt}/)@@** 18 bytes • q~{,}$_z,f{W$e]}p; 16 bytes • q2>i25A5]:md]W%p 23 bytes • q~${_0=2$1=>{+$3%}|}*]p Dennis agreed to join forces :)


9

C#, no usings, 234 bytes new int() // 0 -~new int() // 1 -~-~new int() // 2 -~-~-~new int() // 3 -~-~-~-~new int() // 4 -~-~-~-~-~new int() // 5 -~-~-~-~-~-~new int() // 6 -~-~-~-~-~-~-~new int() // 7 -~-~-~-~-~-~-~-~new int() // 8 (...


9

PHP, 157 145 91 bytes First time posting on Code Golf, figured I'd give it a shot. I'll get better eventually :P If you see any obvious (to you) spots where I could save characters, let me know. EDIT: Realized I didn't need the semicolons, since these are just snippets. EDIT2: Thanks to Blackhole for many suggestions! LC_ALL DNS_A ~~M_E ~~M_PI LOCK_NB ...


9

PowerShell, 147 bytes These use + to implicitly cast things to integers. The later numbers use Enums from the .Net Framework unerpinnings of PowerShell which happen to have the right values. +$a #0, 3 bytes (unset vars are $null, +$null == 0) +$? #1, 3 bytes (bool previous result, default $true, +$true == 1)...


9

Python 2, 191 159 158 157 156 149 146 bytes My first submission ever, I hope I got everything right ! Based on the time I spent on this, I guess there's surely a better one for a few of them. # 0 | Bytes : 5 int() # 1 | Bytes : 5 +True # 2 | Bytes : 6 -~True # 3 | Bytes : 8 -~-~True # 4 | Bytes : 10 -~-~-~True # 5 | Bytes : 12 -~-~-~-~True # 6 | ...


Only top voted, non community-wiki answers of a minimum length are eligible