Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Piglatin
#11
Quote:Not what is was looking for. But since it is short... 10 points!

But... mine can convert a whole sentence... :'(
The Parse function is a super awesome routine that I think superghost created.
am an asshole. Get used to it.
Reply
#12
That Parse routine is almost like C's strtok... I've got one just like it that I wrote a while back. But interesting code, nonetheless... I can go alktay to my riendsfay in igpay atinlay now... wait... I don't have any friends... Sad
j/k
Reply
#13
I have two friends Smile (no, not my computer and porn)
am an asshole. Get used to it.
Reply
#14
Last try for tonight. (Getting sloppy, I know)

Code:
In$ = "chop"
Out$ = ""
SELECT CASE UCASE$(LEFT$(In$, 1))
  CASE IS = "A", "E", "I", "O", "U"
    Out$ = In$ + "-way"
  CASE ELSE
    FOR x% = 2 TO LEN(In$)
      SELECT CASE UCASE$(MID$(In$, x%, 1))
        CASE IS = "A", "E", "I", "O", "U": EXIT FOR
      END SELECT
    NEXT
    L$ = LEFT$(In$, x% - 1)
    R$ = MID$(In$, x%, LEN(In$))
    Out$ = R$ + "-" + L$ + "ay"
END SELECT
PRINT Out$

- Dav
Reply
#15
Pig latin?? Spucatum tauri! [Image: eek6.gif]
img]http://usuarios.vtr.net/~disaster/sigs/annoyizer.php[/img]
Reply
#16
wtf is piglatin?
Reply
#17
It's a silly but popular english language game. Words beginning with vowels have "WAY" attached to it ('igloo' becomes 'igloo-way'). If a word has constants at the beginning, they're move to the end with "AY" at the end. ('string' becomes ing-stray). Words beginning with QU are done like this. ('quest' becomes 'est-quay')

It's worthless talk, but became very popular in the US among both kids and adults.

Here's my last try. This one parses, but periods, question marks, etc, are not handled.

Code:
DECLARE FUNCTION Piggy$ (In$)

PRINT Piggy$("what is pig latin that is the question")
PRINT Piggy$("hello my name is dave and i'm a pig")
PRINT
INPUT "What do you say, pig"; A$
PRINT Piggy$(A$)

FUNCTION Piggy$ (In$)

Out$ = ""

DO UNTIL w >= LEN(In$)
    '=== Parse a word...
    temp$ = ""
    WHILE MID$(In$, w + 1, 1) <> " " AND MID$(In$, w + 1, 1) <> ""
        temp$ = temp$ + MID$(In$, w + 1, 1)
        w = w + 1
    WEND
    '====== piggy it ====
    FOR x% = 1 TO LEN(temp$)
      SELECT CASE UCASE$(MID$(temp$, x%, 1))
        CASE IS = "A", "E", "I", "O", "U", "Y": EXIT FOR
      END SELECT
    NEXT
    '=== If vowel first...
    IF x% = 1 THEN
       Out$ = Out$ + temp$ + "-way "
    '=== If starts with "qu"...
    ELSEIF UCASE$(LEFT$(temp$, 2)) = "QU" THEN
       Out$ = Out$ + RIGHT$(temp$, LEN(temp$) - 2)
       Out$ = Out$ + "-" + LEFT$(temp$, 2) + "ay "
    '=== else...
    ELSE
       L$ = LEFT$(temp$, x% - 1)
       R$ = MID$(temp$, x%, LEN(temp$))
       Out$ = Out$ + R$ + "-" + L$ + "ay "
    END IF
    '====================
    w = w + 1
LOOP

Piggy$ = Out$

END FUNCTION

- Dav
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)