
-----------------------------------
scorpion1087
Tue Nov 04, 2003 1:27 pm

piglatian
-----------------------------------
what is it?

how do you change a word into piglatian?

-----------------------------------
Dan
Thu Nov 06, 2003 5:38 pm


-----------------------------------
LOL, this has got to be one of the funest question we have got for turing.

i think piglatian is some kind of mest up slang. you whould need to know  alot more about it to make a progame to chage a worad to it. but if you figer out the rules or what ever for it you whould probley need to uses substrings to move the letters around in the string.

dose any one know more about piglatian? b/c i shure dont...

-----------------------------------
nis
Thu Nov 06, 2003 6:43 pm


-----------------------------------
I dont really know much about pig latin but if you want to move letters around in a word do this:


var String, fLetter  : string 
% String is the word being changed
% fLetter is the first letter of that word
var Length : int 
%The length of the word

String := "Hello"
Length := length(String)

fLetter := String (1..1)
String := String (2 .. Length)
String += fLetter



What that does is brings the first letter of a word to the back of the word
Hope that helps

-----------------------------------
Chimaera
Wed Nov 12, 2003 11:42 pm


-----------------------------------
I pretty much have the core code of it down and it even works up to the point until we have a vowel for the first letter and then it just gets for looped. For the first if condition, it exits properly when it's outputted but I don't understand why the second one doesn't do the same. And also, is there a faster way to get the consonants/vowels be sorted into individual arrays, or do I have to manually declare all of them? 


var word : string
var consonant : array 1 .. 20 of string
var vowel : array 1 .. 6 of string
consonant (1) := "b"
consonant (2) := "c"
consonant (3) := "d"
consonant (4) := "f"
consonant (5) := "g"
consonant (6) := "h"
consonant (7) := "j"
consonant (8) := "k"
consonant (9) := "l"
consonant (10) := "m"
consonant (11) := "n"
consonant (12) := "p"
consonant (13) := "q"
consonant (14) := "r"
consonant (15) := "s"
consonant (16) := "t"
consonant (17) := "v"
consonant (18) := "w"
consonant (19) := "x"
consonant (20) := "z"
vowel (1) := "a"
vowel (2) := "e"
vowel (3) := "i"
vowel (4) := "o"
vowel (5) := "u"
vowel (6) := "y"
put "What is the word you want to translate into pig latin?"
get word
for i : 1 .. 20
    for j : 1 .. 6
        if word (1) = consonant (i) and word (2) = vowel (j) then
            put "The word translated in pig latin is : ", word (2 .. *) + word (1), "ay"
        elsif word (1) = vowel (j) then
            put "The word translated in pig latin is : ", word, "yay"
        end if
        exit when word (1) = vowel (j)
    end for
end for


-----------------------------------
hackman
Thu Nov 13, 2003 11:02 am


-----------------------------------
oolcay rogrampay anmay

-----------------------------------
Chimaera
Sat Nov 15, 2003 10:30 pm


-----------------------------------
please help me out! I'm pretty confused as to what to do with the program to fix it!

-----------------------------------
thoughtful
Sat Nov 15, 2003 11:19 pm


-----------------------------------
well the problem was with ur elsif statement it outputted the word 20 times if the first word was a vowel, i fixed it for ya.

var word : string
var consonant : array 1 .. 20 of string
var vowel : array 1 .. 6 of string
var vowelcheck : boolean := false
consonant (1) := "b"
consonant (2) := "c"
consonant (3) := "d"
consonant (4) := "f"
consonant (5) := "g"
consonant (6) := "h"
consonant (7) := "j"
consonant (8) := "k"
consonant (9) := "l"
consonant (10) := "m"
consonant (11) := "n"
consonant (12) := "p"
consonant (13) := "q"
consonant (14) := "r"
consonant (15) := "s"
consonant (16) := "t"
consonant (17) := "v"
consonant (18) := "w"
consonant (19) := "x"
consonant (20) := "z"
vowel (1) := "a"
vowel (2) := "e"
vowel (3) := "i"
vowel (4) := "o"
vowel (5) := "u"
vowel (6) := "y"
put "What is the word you want to translate into pig latin?"
get word
for i : 1 .. 20
    for j : 1 .. 6
        exit when vowelcheck = true
        if word (1) = consonant (i) and word (2) = vowel (j) then
            put "The word translated in pig latin is : ", word (2 .. *) + word (1), "ay"
        elsif word (1) = vowel (j) then
            put "The word translated in pig latin is : ", word, "yay"
            vowelcheck := true
        end if
        exit when word (1) = vowel (j)
    end for

end for


-----------------------------------
AsianSensation
Sun Nov 16, 2003 2:00 pm


-----------------------------------
here is a suggestion for assigning values to your array variables, instead of manually typing all those stuff out, let the computer do it, just use sub-strings

var ConsonantTot := "bcdfghjklmnpgrstvwxz"
var VowelTot := "aeiouy"
var Consonant : array 1 .. 20 of string
var Vowel : array 1 .. 6 of string

for rep : 1 .. 20
    Consonant (rep) := ConsonantTot (rep)
end for
for rep : 1 .. 6
    Vowel (rep) := VowelTot (rep)
end for

-----------------------------------
Andy
Mon Nov 17, 2003 6:37 pm


-----------------------------------
lol or use ascii values?

-----------------------------------
Tony
Mon Nov 17, 2003 6:40 pm


-----------------------------------
lol or use ascii values?
ASCII value not gonna say if its a vovel or not :roll:
