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 |
A competition to solve a particular problem through the usage and manipulation of strings.
1
vote
Determine the "Luck" of a string
Python 3, 168 157 152 139 144 136 bytes
EDIT: Really obvious things I should have seen easier have been changed, and some slightly less obvious.
Edit 2: stoopid (˚n˚). The program threw errors. I fi …
1
vote
Exploded view of a string
Python, 107
Could be shortened by lambda, but later
x=sorted(input())
i=0
while i<len(x):x[i:]=[' '*(x[i]!=x[i-1])]+x[i:];i-=~(x[i]!=x[i-1])
print("".join(x))
0
votes
The shortest code to invert bit-wise a binary string
take input into string variable
- decrement the string pointer (used when writing char from string)
[* ] while current cell is not *
+. … increment string pointer, write pointed char from string
(1'0r) if cell is 1, write 0, move right
(0'1r) if cell is 0, write 1, move right …
1
vote
Element of string at specified index
input the string into the string variable
? input the number into the number variable
: this command takes the number variable and moves right that many. … pointer. the string pointer is used with the string var;
when you want to write something from the string, you use `.`, which writes
the pointed char. the pointed char is the n-th …
28
votes
24
answers
3k
views
Which ghosts are missing?
You must do it in as few bytes as you can
Input
Input will consist of a string or list, which will include a number ghosts, which could include:
Blinky
Inky
Pinky
Clyde
However, input may also include … It can be assumed that no invalid items will be in the list
Output
Output will consist of a string, or list. This will include of all the ghosts that are not in the input, in any order. …
7
votes
Draw diagonal lines of text
Explanation
(write means writing to the cell on the grid, pointed char means char in input the string pointer points to)
! … _+ write * if end of input, else ' ', increment string pointer
_ will always write ' ', since it will always point at start char
note trailing space. …
394
votes
50
answers
59k
views
Covfefify a string
In this challenge, you must take a string matching the regex ^[a-zA-Z]+$ or whatever is reasonable (you don't have to consider uppercase or lowercase letters if you want) (you may assume the string is … You can assume that this consonant is not at the end of the string. …
2
votes
Can Pac-Man Eat This String?
Python 3, 114 110 bytes
My first code golf.
Thanks to Dr Green Eggs and Iron Man for saving 4 bytes.
l,x=1,0
f,y,s="ghosGHOS","pelPEL",input()
while s[x:]*l:l+=(s[x]in y)-(s[x]in f);x+=l>0
print("_ …
0
votes
"99 Bottles of Beer"
Python 3, 234 bytes
i=99
s='s'
b='%s bottle%s of beer'
o=' on the wall'
y=b%(i,s)
while i:print(y+o+', '+y+'.');i-=1;s=('',s)[i>1];y=b%(i,s);print(('Take one down, pass it around, '+y+o+'.\n','Go to …
2
votes
Generate a Stack Exchange Favicon
Python 3, 121 124 bytes
Fixed stupid mistake
s=''
for i in input():_=ord(i);s+=("",i)[91>_>64or 47<_<58]
x=len(s)
c='+'+"-"*x+'+'
print(c+"\n|"+s+"|\n"+c+"\n"+" "*x+"v")
does not import libraries …
0
votes
Random Golf of the Day #7: A distinctly random character
Python 3, 58 bytes
from random import*;print(chr(randint(65,randint(65,91))))
it is like that perl answer.
5
votes
Wave-Particle Duality Laterally Programmatically
Vim, 27 23 keystrokes
First vim answer ever, haven't used vim at all really even.
A/<esc>:s#//#/\\<cr>:s#\./# .<cr>
How it works: It appends a / at the end of line, subs // for /\, subs ./ for .
1
vote
Is it an Odd Word?
Turtlèd, 91 65 64 52 47 67 bytes
More bytes because now takes case insensitive input
Changed approach again
does * for even, else o for odd
(trailing space)
!-u[*+.(a,)(e,)(i,)(o,)(u,)(A,)(E,)(I, …
1
vote
Esolang-Comment-Template-Generator
take input into string variable
' write space over current cell
[* ] while cell is not *
.+ write pointed … char of string, stringpointer+1 (starts 0)
(| ) if current cell is |
' dl write space (over |), move down, left
r_ …
1
vote
Wave-Particle Duality Laterally Programmatically
take input into string var, char pointer=0, 1st char
- decrement char pointer, mod length input
[* ] while current cell isn't *: … increment string pointer, and write the pointed char
r_ move right, write * if pointed char is last char, else " "
l move left …