Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results for cjam
Search options not deleted user 194
8 votes

One OEIS after another

nFj,(a+1)o-:(t@(h+1)@j-t@h@j)*(t@(h+1)@(a-j)) o Online demo Next sequence Fun fact: when the challenge was first posted, I drew up a list of small nasty sequence numbers that I wanted to aim for with CJam
DLosc's user avatar
  • 39.2k
1 vote

How many spaces are there?

CJam (5 bytes) q' e= Online demo qS/,( Online demo …
Peter Taylor's user avatar
  • 43.1k
1 vote

Count the number of shortest paths to n

CJam (27 bytes) qi2a{{_W$,f#f+~2}%_W$&!}ge= Online demo Warning: this gets very memory-intensive very fast. …
Peter Taylor's user avatar
  • 43.1k
2 votes

Parsing text written the millitext font

CJam (63 bytes) {{Gb"õáÖÅ{a("{i%}/" @/Ö´çýß}yùÜÅ©GôÉç¢"256b43b'0f+=}%} or in xxd format 0000000: 7b7b 4762 22f5 e1d6 c59f 7b61 2822 7b69 {{Gb"..... …
Peter Taylor's user avatar
  • 43.1k
2 votes

Nth term of Van Eck Sequence

CJam (15 bytes) 0a{_(#)\+}qi*0= Online demo. This is a full program and 0-indexed. …
Peter Taylor's user avatar
  • 43.1k
1 vote

Output the Euler Numbers

CJam (34 bytes) {1a{_W%_,,.*0+(+W%\_,,:~.*.+}@*W=} Online demo which prints E(0) to E(19). This is an anonymous block (function). … The implementation borrows Shieru Akasoto's recurrence and rewrites it in a more CJam friendly style, manipulating entire rows at a time. …
Peter Taylor's user avatar
  • 43.1k
3 votes

Binary Numbers Magic Trick

CJam (18 bytes) 6{61{2A#&},5/zp}fA Online demo. This is a full program which outputs to stdout. …
Peter Taylor's user avatar
  • 43.1k
3 votes

Amount of permutations on an NxNxN Rubik's Cube

CJam (47 bytes) qi[1_7m!Z6#*_3*Cm!*2D#*]{2-_j24_m!\6#:P/@#*P*}j Online demo This implements Herbert Kociemba's recursion from OEIS: $$a(n) = \begin{cases} 1 & \textrm{ if } n \in \{0,1\} \\ 7! … I've ordered the terms in the MathJax block in the same order as in the code to make the correspondence easy to verify for those who read CJam: any further dissection is not going to shed more light. …
Peter Taylor's user avatar
  • 43.1k
10 votes
Accepted

Counting the number of restricted forests on the Möbius ladder of length n

CJam (58 56 chars) Some characters unprintable, and one is a tab which will be mangled by the StackExchange software: "¶3¬î¿Á· 7ÛÈmÈÚÚ¡"256b454b212f-{__W%.*A<1b+}qi*-4= Online demo. …
Peter Taylor's user avatar
  • 43.1k
1 vote

Cycles on the torus

CJam (50 chars) q~]:M:!a{9Yb2/\f{_W=@.+M.%a+_)a#g"WAR"=~}}:R~e_We= Online demo. This is a program which takes two inputs from stdin. …
Peter Taylor's user avatar
  • 43.1k
1 vote

Make me a metasequence

CJam (20 bytes) 1aK*{1\{1$+}/;]}q~*p Online demo. …
Peter Taylor's user avatar
  • 43.1k
2 votes

Superpermutations

CJam (6 * 240 = 1440) 5e! … Approach stolen from Sanchises, although the permutation order of CJam is different, giving a different substring. CJam (22 * 207 = 4554) 0a4{)W@+W+1$)ew\a*W-}/ Online demo, validation. …
Peter Taylor's user avatar
  • 43.1k
7 votes

Number of \$n\$-carbon alkanes

adding two rules: T+2c->b+T S+2c->d+S which inline a route through the existing rules T+c->ay ay+c->b+T S+c->ax ax+c->d+S Partial dissection At a high level, this uses the same approach as my CJam … Here is the minimiser (in CJam), which makes a few assumptions about the code but could be adapted to minimise other Alchemist programs: e# Obfuscate / minimise Alchemist program e# Tokenise qN%[SNS] …
Peter Taylor's user avatar
  • 43.1k
11 votes
Accepted

Number of \$n\$-carbon alkanes

CJam (100 98 91 89 83 bytes) 1a{_[XX]*\_{_0a*}:E~\{E\_{ff*W%{0@+.+}*}:C~.+2f/}:D~.+C.+3f/1\+}q~:I*DE1$D.-X\+.+I= Takes input from stdin, outputs to stdout. …
Peter Taylor's user avatar
  • 43.1k
0 votes

Ionic Compound Golf

CJam (137 bytes) {{"SO4CO3ClBrFINO3OHNaAgKLiNH4BaCaCuMgZnPbFeAl":I\#~}$_s"HOH"="HO"1/@?_{I\#G-_0<B*-B/_W>+z}%_~1$=\1?f/W%[. …
Peter Taylor's user avatar
  • 43.1k

1
2 3 4 5
12
15 30 50 per page