Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Piglatin
#1
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!
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#2
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.
Reply
#3
and your point. i dont see the trouble
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#4
Unless you really need this program very badly, I can't be bothered to spend that much time on it Wink Too much other stuff going on for meh... Sad
earn.
Reply
#5
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.
Reply
#6
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.
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#7
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$
Reply
#8
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. Big Grin Good luck on your programming endeavours, anyhow. Maybe you'll write the next Google! Smile
Reply
#9
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!
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#10
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)