Posts: 2,765
Threads: 138
Joined: Nov 2002
Make a program that turns and inputed string to pig latin.
You should know what pig latin is but if you don't this is pig latin...
String: Cat
Piglatin: atcay
or
String: Igloo
Piglatin: Iglooway
Go!
Etlay eesay owhay oodgay ouyay areway!
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 1,813
Threads: 284
Joined: Mar 2003
I could do it, but it would take too much work for this simple little program... like, I mean, a ridiculous amount of work.
earn.
Posts: 2,765
Threads: 138
Joined: Nov 2002
and your point. i dont see the trouble
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 1,813
Threads: 284
Joined: Mar 2003
Unless you really need this program very badly, I can't be bothered to spend that much time on it Too much other stuff going on for meh...
earn.
Posts: 1,166
Threads: 62
Joined: Apr 2003
I only made it take the first letter. The other kinds I couldn't bother with.
Code: DEFINT A-Z
DECLARE FUNCTION Parse$ (Word$, Sep$, Word%)
CLS
INPUT "Sentence to Tranlate?", trans$
m = 1
FOR n = 1 TO LEN(trans$)
l = INSTR(m, trans$, " ")
IF l THEN m = m + l: k = k + 1
NEXT
FOR o = 1 TO k + 1
daword$ = Parse$(trans$, " ", o)
endin$ = LEFT$(daword$, 1)
wordout$ = RIGHT$(daword$, LEN(daword$) - 1) + endin$ + "ay"
PRINT wordout$ + " ";
NEXT
DEFSNG A-Z
FUNCTION Parse$ (Word$, Sep$, Word%)
l% = 1: S% = 1
W$ = Sep$ + Word$ + Sep$
DO
S% = INSTR(S% + 1, W$, Sep$): IF S% = 0 THEN EXIT DO
SELECT CASE S%
CASE 0: EXIT FUNCTION
CASE IS > 1: Wd% = Wd% + 1
IF Wd% = Word% THEN Parse$ = MID$(W$, l% + LEN(Sep$), S% - l% - LEN(Sep$)): EXIT DO
END SELECT
l% = S%
LOOP
END FUNCTION
am an asshole. Get used to it.
Posts: 2,765
Threads: 138
Joined: Nov 2002
Ninkazu: The first letter!
Igloo is "iglooway" not "glooiay"
chop is "opchay" not "hopcay"
Close but not quite an all english - pig latin word converter.
Mine is kinda mess up but it works. But it only does a word at a time. Not setences like yours. Nice.
Ninkazu - 4 points
If it worked with all words you would have gotten higher.
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 440
Threads: 65
Joined: Sep 2001
Not sure exactly how pig latin works. All I know about it is from an old 3 stooges clip.
Anyway, here's a quick, throw-together...
Code: In$ = "david"
Out$ = ""
SELECT CASE UCASE$(LEFT$(In$, 1))
CASE IS = "A", "E", "I", "O", "U"
Out$ = In$ + "-way"
CASE ELSE
Out$ = RIGHT$(In$, LEN(In$) - 1)
Out$ = Out$ + "-" + LEFT$(In$, 1) + "ay"
END SELECT
PRINT Out$
Posts: 1,439
Threads: 15
Joined: Apr 2003
This is insanely difficult... you'd have to write some sort of natural language engine to figure out how stuff should be pronounced, then write rules to move certain characters certain places, etc, etc... it's not really worth it. But if you have working code, I'd like to give it a whirl, just to see if I could make it break. Good luck on your programming endeavours, anyhow. Maybe you'll write the next Google!
Posts: 2,765
Threads: 138
Joined: Nov 2002
Quote:Not sure exactly how pig latin works. All I know about it is from an old 3 stooges clip.
Anyway, here's a quick, throw-together...
Code: In$ = "david"
Out$ = ""
SELECT CASE UCASE$(LEFT$(In$, 1))
CASE IS = "A", "E", "I", "O", "U"
Out$ = In$ + "-way"
CASE ELSE
Out$ = RIGHT$(In$, LEN(In$) - 1)
Out$ = Out$ + "-" + LEFT$(In$, 1) + "ay"
END SELECT
PRINT Out$
Short. cool. But I changed "david" to "chop" it printed
hop-cay
Not what is was looking for. But since it is short... 10 points!
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 440
Threads: 65
Joined: Sep 2001
Oh, I see now. Ok. I'll try it again, but I'll have to wait for tommorrow. I'm out of time tonight. Bye.
- Dav
|