27
6
My friend made a lisp translator the other day, that is to say it took a string and converted s=>th and S=>Th. It was quite long and I thought that it could be golfed.
So the task is to make a program/function that takes an input string, translates it in to lisp and outputs the string
Test case
Sam and Sally like Sheep Tham and Thally like Thheep
Sally likes sausages Thally liketh thauthageth
Sally sells seashells Thally thellth theathhellth
Note that it doesn't matter that h gets repeated all the time
This is code golf so shortest answer wins
13I wished everyone would change the bytes in their headers to byteth. – Leaky Nun – 2016-06-17T17:14:49.153
May someone show this challenge to Mike Tyson? – user8397947 – 2016-06-17T18:25:23.133
6There should be bonus points if the program doesn't use
s
norS
anywhere in it. – Nate Diamond – 2016-06-17T18:41:14.557@NateDiamond great idea, but too late for that, i'm afraid. – Mindwin – 2016-06-17T19:15:19.080
Thufferin' thuccotathh! – mbomb007 – 2016-06-17T20:58:56.860
1I think the language names should be made clear. Without the replacement. Some languages contain "th" already, so it's ambiguous. And who's to say that someone won't create a different language actually called "Common Lithp" in the future? – mbomb007 – 2016-06-17T21:02:27.783
1@mbomb007 I wouldn't worry about it too much. I'm not sure if there is actually a default way to title your answer. Most question I see if they do state how to do it it is normally the same way. As I haven't explain how the answer should be set out, then users are free to title them how they want to. Being a pedant, I didn't even ask for a language, so I could argue against them even writing them. But I do understand your point. I just don't think it is of concern – george – 2016-06-17T21:09:40.213
2A thing that would have made this challenge more interesting would be overall case preservation, e.g.
LOOK OUT A SNAKE!!! -> LOOK OUT A THNAKE!!!
– fluffy – 2016-06-18T03:06:05.7601@fluffy after writing the question I did realise a case like that would fail, but it is too late to change now – george – 2016-06-18T07:37:13.013
1Welcome to Programming Puzzleth & Code Golf! That Ith a Good quethtion and thothe help the community a lot! – None – 2016-07-05T10:15:42.830