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.
3
votes
Write a function that returns past tense of given verb
Groovy - 111 characters
v={it==~'[aeiou]'};p={s->r=s[0..-2];a=s[-1];b=v s[-2];(a=='e'?r:a=='y'?!b?r+'i':s:v(s[-3])|!b|v(a)?s:s+a)+'ed'}
assert ['jump', 'ask', 'love', 'move', 'study', 'cry', 'play', …
2
votes
How to randomize letters in a word
Groovy, 75
r={w->w.size()<3?w:w[0]+w[1..-2].toList().sort{Math.random()}.join()+w[-1]}
assert r('a') == 'a'
assert r('it') == 'it'
assert r('cap') == 'cap'
for(x in 1..10) {
def w = r('Honorifi …
0
votes
Determine whether strings are anagrams
Groovy, 46
b={args[it].toList().sort()}
print b(0)==b(1)
1
vote
1, 2, Fizz, 4, Buzz
nodejs repl, 60 bytes
for(i=0;++i<101;util.puts(i%5?s||i:s+'Buzz'))s=i%3?'':'Fizz'
With latest node, this prints a deprecation warning to the console. This presumably violates the rule about print …