Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 piglatian
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
scorpion1087




PostPosted: Tue Nov 04, 2003 1:27 pm   Post subject: piglatian

what is it?

how do you change a word into piglatian?
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Thu Nov 06, 2003 5:38 pm   Post subject: (No subject)

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...
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
nis




PostPosted: Thu Nov 06, 2003 6:43 pm   Post subject: (No subject)

I dont really know much about pig latin but if you want to move letters around in a word do this:

code:

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




PostPosted: Wed Nov 12, 2003 11:42 pm   Post subject: (No subject)

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?

code:

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




PostPosted: Thu Nov 13, 2003 11:02 am   Post subject: (No subject)

oolcay rogrampay anmay
Chimaera




PostPosted: Sat Nov 15, 2003 10:30 pm   Post subject: (No subject)

please help me out! I'm pretty confused as to what to do with the program to fix it!
thoughtful




PostPosted: Sat Nov 15, 2003 11:19 pm   Post subject: (No subject)

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.
code:

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




PostPosted: Sun Nov 16, 2003 2:00 pm   Post subject: (No subject)

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

code:
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
Sponsor
Sponsor
Sponsor
sponsor
Andy




PostPosted: Mon Nov 17, 2003 6:37 pm   Post subject: (No subject)

lol or use ascii values?
Tony




PostPosted: Mon Nov 17, 2003 6:40 pm   Post subject: (No subject)

dodge_tomahawk wrote:
lol or use ascii values?

ASCII value not gonna say if its a vovel or not Rolling Eyes
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: