Search Results
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 |
Code-golf is a competition to solve a particular problem in the fewest bytes of source code.
0
votes
Shortest hex dumping program
C# .NET Framework 4.7.2 - 235 213 203 191 175 140 bytes
Try it online!
using System.IO;class P{static void Main(string[]a){foreach(var b in File.ReadAllBytes(a[0])){System.Console.Write(b.ToString(" …
1
vote
Emulate a 7-segment display
JavaScript, 148 bytes
e=>(e[0]==1?" #\n":"\n")+(e[5]==1?"#":" ")+(e[1]==1?" #\n":"\n")+(e[6]==1?" #\n":"\n")+(e[4]==1?"#":" ")+(e[2]==1?" #\n":"\n")+(e[3]==1?" #\n":"\n")
Try it online! (Footer i …
0
votes
Shortest hex dumping program
05AB1E, 18 bytes
IvyÇh2j' 0.:' Jvy?
Try it online!
Explanation:
IvyÇh2j' 0.:' Jvy?
Iv Loop through each character in input
y Push current character
Ç …
15
votes
29
answers
4k
views
Shortest hex dumping program
Challenge
Create a console program to display each byte of a file.
Winning
Since this is code-golf, fewest bytes wins.
Rules
Program must be a console application, meaning that it will be ra …
2
votes
Produce the number 2014 without any numbers in your source code
05AB1E, 22 10 8 7 6 bytes
T·žvÍJ
Try it online!
How it works:
T pushes 10, · doubles it, we get 20.
žv pushes 16, Í subtracts 2, we get 14.
Lastly, we concatenate them using J!
1
vote
Sum square difference
JavaScript (Node.js), 59 48 47 bytes
n=>(a=(x,b)=>x&&x*(b||x)+a(--x,b))(n,1)**2-a(n)
Try it online!
2
votes
Make your code error, but only sometimes!
JavaScript (Node.js), 17 15 14 bytes
new Date%2?a:0
Errors if current millisecond is odd
new Date returns current epoch time
%2 modulo 2, returns 1 if odd, 0 if even
if it's a truthy value (1), a wi …
1
vote
Simple cat program
05AB1E, 2 bytes
I?
Try it online!
Blank program is not allowed since OP specified "You should write a full program which reads..."
0
votes
Who's that Pokémon?
JavaScript, 1277 1276 bytes
n=>";Bulbasaur;Ivysaur;Venusaur;Charmander;Charmeleon;Charizard;Squirtle;Wartortle;Blastoise;Caterpie;Metapod;Butterfree;Weedle;Kakuna;Beedrill;Pidgey;Pidgeotto;Pidgeot;Ra …
1
vote
Draw an ASCII envelope based on size input
05AB1E, 68 bytes
ð'_IиJJÂJUX,I<F'|ðNи'\N>I<Qi'_ëð}IN-<·и'/ðNи'|JJ,}I2‹i"|\/|"ëXð'|:},
Try it online!
Explanation:
ð Push space
'_Iи Push I underscores (I = input)
JJÂJ …
6
votes
Recreate a 'Snake' game in a console/terminal
C# .NET Framework 4.7.2 Console (2,456 2,440 2,424 2,408 2,052 1,973 1,747 1,686 bytes)
This was fun, but I really had to think what variables were what, because they are only one letter.
using m=Syst …
2
votes
10 PRINT CHR$(205.5+RND(1)); : GOTO 10 in PHP (or anything else, for that matter)
PowerShell, 108 90 86 54 53 37 36 bytes
for(){Write-Host "\/"[(Random 2)]-n}
Try it online!
1
vote
Program that creates larger versions of itself (quine-variant)
Bash, 14 bytes
cat $0&cat $0&
Try it online!
2
votes
Make me a square!
05AB1E, 7 6 bytes using the canvas and compressed integers.
3IŽ9¦Λ
Try it online!
0
votes
'abc' and 'cba'
Bash / 05AB1E, 27 bytes
"printf" "abc\n" '#' r.ÁR¦¦
Try it online Bash
"printf" "abc\n" '#' r.ÁR¦¦
│ │ └useless arguments
│ └abc\n argument
└printf command
Try it online! 05AB …