vityavv
  • Member for 4 years, 7 months
  • Last seen more than a month ago
Make a transparent 448*448 image
28 votes

Imagemagick in some shell, 35 convert -size 448x448 xc:none a.png Is this allowed?

View answer
Make a transparent 448*448 image
8 votes

Go, 70 import i"image";func a()i.Image{return i.NewRGBA(i.Rect(0,0,448,448))} Never seen a golf in Go before. Defines a function called a that outputs the image

View answer
Create chunks from an array
5 votes

Brainfuck, 71 bytes ,[>+>+<<-]>>>,[<[>.,<-]>>>++++[<++++++++>-]<.[-]<<<[<+>>+<-]<[->+<]>>>] Dunno if this ...

View answer
Sum integers in a string
3 votes

Bash, 43 bytes for n in ${1//[!0-9]/ };{((s+=n));};echo $s Replaces every non-number with a space, and then sums them together. -5 bytes thanks to GammaFunction

View answer
Execute a Superb Shuffle™
3 votes

JavaScript, 27 Another one based off of the ruby answer d=>d.map((_,i)=>d[i*17%54]) Edited in an obvious shortening

View answer
Dynamically Create Boxes
3 votes

brainfuck, 145 bytes +++++++++[>++++++++++<-]>+[>+>+<<-]>>++>,>+++++++++[<----->-]<--->>>,>+++++++++[<----->-]<--->++++++++++<[<...

View answer
Make me speak L33T
2 votes

Brainfuck, 475 bytes >,[>+++++++++++[<------>-]<[>++[<+++++>-]]<[<]>>++[<----->-]<---[>+++[<++++++>-]]<[<]>>+++[<------>-]<--...

View answer
That's not my X, its Y is too Z
2 votes

JavaScript, 129 (a,b,c)=>(z='',a.forEach((f,i)=>z+=`That's ${q=i!=5?"not ":""}my ${f}${q?", i":"! I"}ts ${b[i]} is ${q?"to":"s"}o ${c[i]}.\n`),z) input is three arrays, returns string

View answer
Would this string work as string?
2 votes

Bash, 30 bytes grep -E '//|\\\\|_~|~_|~/|_\\|/_|\\~' Input is STDIN. Exit code is 1 if valid, 0 if invalid.

View answer
Am I not good enough for you?
2 votes

Javascript, 62 n=>n==[...Array(n).keys()].filter(a=>n%a<1).reduce((a,b)=>a+b) Explanation (although it's pretty simple) n=> //return function that takes n n== //and returns if n is ...

View answer
Ones and Twos for days
1 votes

Brainfuck, 72 +++++++[>+++++++<-]>[>+>+<<-]>>+[<.>>+[>+>+<<-]>[<<.>>-]>[<<+>>-]<<<<.>] Might be able to ...

View answer
Draw a distribution diagram!
1 votes

JavaScript, 239 I'm sorry about this, but the variables were just named willy-nilly. Anyway, the question said any convenient format, so this function returns a sideways graph f=>{x=Math;z=Array;...

View answer
Woody words, tinny words
1 votes

JavaScript, 60, 50 EDIT I saw all the other regex answers. I guess I'm just blind. Anyway, here's one using the same regex i=="leap"?"PVC":/.p.|is*t/.test(i)?"tinny":"woody" Also, now, it beats the ...

View answer
Return the nth element of an array even if its out of bound
0 votes

Javascript, 28 bytes a=>i=>a[(i<0?-i:i)%a.length]

View answer
FizzBuzz but time-based
0 votes

Bash, 154 z=$(($(date +%s)-$(date -d "$(date +%F) 0" +%s))) [[ 0 -eq "($z%3)" ]]&&a=1&&echo -n "fizz" [[ 0 -eq "($z%5)" ]]&&echo "buzz"||[ $a -eq 1 ]&&echo||echo $z ...

View answer
Parse a C++14 integer literal
0 votes

Go, 75 import "strconv" func(i string)int64{n,_:=strconv.ParseInt(i,0,0);return n}

View answer
Offset in split text content
0 votes

Bash, 66 bytes z=$(echo ${i:0:o});echo $z|sed 's/^.* //g'|wc -c;set -- $z;echo $# 1-indexed. $i contains the input, and $o contains the offset Explanation: z=$(echo ${LDS:0:o}); # delete ...

View answer
Output visual diagram of picture
0 votes

Javascript, 158 bytes (w,h,m,f)=>(q="repeat",(z=("#"[q](w+2*(m+f)))+` `)[q](f))+(x=((e="#"[q](f))+(r="+"[q](m))+(t="+"[q](w))+r+e+` `)[q](m))+(e+r+"X"[q](w)+r+e+` `)[q](h)+x+z) Can probably be ...

View answer
Rounded Rectangles
0 votes

JavaScript, 143 n=>(x=Math.floor(n/4),q=n%2==1?x+1:x,` ${"o".repeat(q)} ${Array(n%4==2||n%4==3?x+1:x).fill(`o${" ".repeat(q)}o`).join`\n`} ${"o".repeat(x)}`)

View answer
TyPe LiKe ThIs AnD iRrItAtE yOuR fRiEnDs
0 votes

JavaScript, 116 s=>{x=!0;return s.split("").map(e=>{if(e.match(/[a-zA-Z]/))x=!x;return x?e.toUpperCase():e.toLowerCase()}).join("")} Saved two bytes thanks to NTCG

View answer
How many arguments were passed?
0 votes

Brainfuck, 27 >>,[>,]<[[-]<[<]<+>>[>]<]. Try it online! "arguments" are single characters. output is in ASCII (eg 32 args outputs a space). In order to see output ...

View answer
Count up folks!
0 votes

Brainfuck, 24 bytes (-4.8 = 19.2) >>,[[>+>+<<-]>>-]<.[<<.] Technically it can go as high as you want as long as you set your cell size high enough. Also all I/O is ...

View answer
Is there an unmatched parenthesis in this String?
0 votes

Javascript, 149 140 bytes New solution incorporates bitwise operators (Thanks, arjun) and calculates if they are not equal, and uses or instead of and. function f(x){return x.split("(").length!=x....

View answer