GET OVER HERE HUMAN

GET OVER HERE HUMAN

WRITE A FUNCTION IN THE LANGUAGE OF YOUR CHOICE THAT TAKES A STRING AS INPUT, DOUBLES EVERY CONSONANT AND PLACES AN 'O' IN BETWEEN.

FOR EXAMPLE, 'I'M A GIANT FAGGOT' SHOULD RETURN 'I'MOM A GOGIANONTOT FOFAGOGGOGTOT".

TICK TOCK, BIRD DOESN'T LIKE WAITING.

PUMP A RUM

def foo(string):
result = ""

for letter in string:
if letter != " ":
result += letter
result += "O"
result += letter
else:
result += letter

return result

PICKLE PEE

WHAT ARE REGULAR EXPRESSIONS.

STOP POSTING TRIVIAL EXERCISES. WHAT IS THIS, HIGHSCHOOL COMPUTER LAB?

FUCK OFF.

THEN DO IT

...

HOW ABOUT YOU FIX YOUR OWN CODE FIRST.

who is birding who ?

DO YOU WANT TO BE HIRED, BIRD POSER

WHOM BOI

import string
vows="EeUuIiOoAa"
cons=filter(lambda x: x not in vows,string.letters)
def shit_tier_challenge_16271627812(txt):
return reduce(lambda x,y: x+y+"o"+y if y in cons else x+y, txt, "")


Could have been a nice one liner if I wasn't bored to write all the consonants myself or a two liner with import string if I wasn't disgusted from the idea of generating cons every time reduce looped through

Yeah this one is stupid.

THIS IS FIZZBUZZ LEVEL PROGRAMMING, NOBODY IS GOING TO HIRE YOU TO FIZZBUZZ.

FIGHT BIRDS, FIGHT

Will crash on special symbols

Here is my solution
#include
#include
#include
#include
#include

using namespace std;

int main() {
vector cons;
queue res;
char symb[] = { 'b', 'c', 'd', 'f', 'g', 'h', 'j',
'k', 'l', 'm', 'n', 'p', 'q', 'r', 's',
't', 'v', 'w', 'x', 'z'};
for (int i = 0 ; i < sizeof(symb)/sizeof(symb[0]); i++) {
cons.push_back(symb[i]);
cons.push_back(toupper(symb[i]));
}

string input;
getline(cin,input);

char ch[input.size()];
strcpy(ch, input.c_str());

for (int i = 0 ; i < input.size() ; i++) {
if (find(cons.begin(), cons.end(), ch[i]) != cons.end()) {
res.push(input[i]);
res.push('o');
res.push(input[i]);
} else {
res.push(input[i]);
}
}

while(res.size()) {
cout

Just do your own homework.

p $*[0].chars.map{|c|/[bcdfghjklmnprstvwxyz]/i=~c ?c+'O'+c : c}.join

>fake knifebird poster

function doTheThing(){
var string = prompt("Enter a sentencef");
var result = [];

for(i=0; i

maybe for an internship they might lel

function fag(x) {
return x.split('').reduce((a,b)=>{return a+((b.match(/[aeiou' ]/i))?b:(b+(b==b.toUpperCase()?'O':'o')+b))})
}

> fag("IM A GIGANTIC FAGGOT")
'IMOM A GOGIGOGANONTOTICOC FOFAGOGGOGOTOT'
> fag("foo bar baz")
'foo bobaror bobazoz'

In Ruby it's a one liner:

"I'M A GIANT FAGGOT".gsub(/[^AEIOU '.!?]/) {|i| i+'O'+i}

Doesn't handle lower case

function ayy(lmao) { return lmao.replace(/([aeiou])/ig, "$1O$1"); };

"I'M A GIANT FAGGOT (and a nitpicker)".gsub(/[^AEIOUaeiou '.!?()]/) {|i| i+'O'+i}

> ayy('foo bar')
'foOooOo baOar'

Good job fag

>puts an uppercase O between lowercase letters

Breaks on other non-consonants not in the regex.

public static string GShit(string input)
{
string output = "";
foreach (char c in input)
{
if
(
c.ToString().ToUpper() != "A" &&
c.ToString().ToUpper() != "E" &&
c.ToString().ToUpper() != "I" &&
c.ToString().ToUpper() != "O" &&
c.ToString().ToUpper() != "U" &&
char.IsLetter(c)
)
{
output += c;
output += 'O';
output += c;
}
else
{
output += c;
}
}
return output;
}

read the question again

what part of the question do you think i missed

He seems to have gotten it correct

you are actually right, i'm a faggot

"that's what I call AUTISM.."
.gsub(/[bcdfghj-np-tv-z]/) {|i| i+'o'+i}
.gsub(/[BCDFGHJ-NP-TV-Z]/) {|i| i+'O'+i}

Nice homework.
def insert_o(sentence):
''.join([w + 'o' + w if w not in 'aeiou' and w not in ' 1234567890\'' else w for w in x])
Also, as said, you should use regular expressions, if you don't want to check against a list of all consonants.
There's too many characters to avoid, and in my example I avoided only digits, space and '. To tell the truth, I only did this because I love list comprehensions.

Except 'x' should be 'sentence'. I done goofed when I copy/pasted the line from the terminal.

Basic map:
while () {
chomp;
@t = map {
!/[aeiou \W]/ ? $_."O".$_ : $_
} split //;
print join "", @t;
print "\n";
}


Monk:
while(){chomp;@t=map{!/[aeiou\W]/?$_."O".$_:$_}split//;print join"",@t;print"\n"}


The "eval" uu guy:
eval unpack u=>q{_=VAI;&4@*#P^*2!["B`@8VAO;7`["B`@0'0@/2!M87`@>PH@("`@(2];865I;W4@7%==+R`_("1?+B)/(BXDY7R`Z("1?"B`@?2!S

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace just_do_it
{
class Program
{
static void Main(string[] args)
{
string doit;
Console.WriteLine("type something");
doit=Console.ReadLine();
doit=DoTheThing(doit);
Console.WriteLine(doit);
Console.ReadLine();

}
public static string DoTheThing(string Sentence)
{
string ReturnedString = "";
foreach(char letter in Sentence)
{
switch(letter)
{
case 'a':
case 'A':
case 'e':
case 'E':
case 'i':
case 'I':
case 'o':
case 'O':
case 'u':
case 'U':
case 'y':
case 'Y':
ReturnedString = ReturnedString + 'O' + letter;
break;
default:
ReturnedString = ReturnedString + letter;
break;

}
}
return ReturnedString;

}
}
}

function conO(str) {
var str = str.replace(/([bcdfghjklmnpqrstvwxyz])/ig, '$1O$1');
return str;
}

Now make it an actual function like it says in the OP

how u put code in a box like this

#ImARetard

Read the fucking sticky

I like the cut of your jib

static void Main(string[] args)
{
var input = Console.ReadLine();
Func isVowel = (char letter) => { return "aouieAOUIE".IndexOf(letter) != -1 ? true : false; };
for (int i = 0; i < input.Length; ++i)
{
if (char.IsLetter(input[i]) && !isVowel(input[i]))
{
input = input.Insert(i, input[i].ToString() + "O");
i += 2;

}
}
Console.WriteLine(input);
}

OP solve your homework yourself faggot

Here come dat boii

static void ConsonantReplacementThingie()
{
string userInput = Console.ReadLine();
char[] vowels = new char[] { 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y' };
List uI = new List();
foreach (char item in userInput){
uI.Add(item);
for (int i = 0; i < vowels.Length; i++){
if (item == vowels[i]){
uI.Add('o');
uI.Add(item);}}}
string output = "";
foreach (char item in uI)
output += item.ToString();
Console.WriteLine(output);
}

What's the boob code?

...

I think OP's problems are too small to be homework. Are you a dropout?

Late to the party again.

#!/usr/bin/env perl
use strict;
use warnings;

my $o;
my $input = 'hello world';

for (split //, $input) {
$o .= $_ =~ /[bcdfghjklmnpqrstvwxyz]/i
? sprintf('%so%s', $_, $_)
: $_;
}

print "$o\n";

ONTO SOMETHING HERE

Half of these can't into special chars or lower case
convert :: String -> String
convert = foldr go []
where
go :: Char -> String -> String
go c str
| c `elem` nonVowels = c : toO c : c : str
| otherwise = c : str

nonVowels :: String
nonVowels = filter (`notElem` "aAeEiIoOuU") (['b'..'z'] ++ ['B'..'Z'])

toO :: Char -> Char
toO c
| c `elem` ['B'..'Z'] = 'O'
| otherwise = 'o'

-- short
convert' :: String -> String
convert'=foldr(\c cs->if c`elem`nVs then c:toO c:c:cs else c:cs) []
where
nVs = filter(`notElem`"aAeEiIoOuU") (['b'..'z']++['B'..'Z'])
toO c = if c`elem`['B'..'Z'] then 'O' else 'o'

>Swedish people on the internet