Go Back   Flash Flash Revolution > General Discussion > Chit Chat
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
Old 06-26-2009, 01:01 AM   #1
tha Guardians
MCDC 2011
FFR Veteran
 
tha Guardians's Avatar
 
Join Date: Nov 2006
Location: location, location~
Age: 84
Posts: 1,680
Send a message via AIM to tha Guardians Send a message via MSN to tha Guardians Send a message via Yahoo to tha Guardians
Default Need help with Javascript

I haven't messed with Javascript or VBScript in a long time.
I'm trying to make a page with a text field and button that will translate Pig Latin to Pig Latin.

I'm pretty sure this can be done using only Javascript.

Anyway, it should work like this:

1.) do you speak pig latin?
2.) oday ouyay peaksay igpay atinlay?
3.) dayoay uyayoay eaksaypay gpayiay tinlayaay?
4.) ayoayday yayoayuay aksaypayeak payiaygay inlayaaytay?
__________________

Quote:
Originally Posted by sonic-fast-fingers View Post
can someone clarrify what QFT means my friend told me its quit ****ing talking, but im not 100 percent sure

Quote:
Originally Posted by Synthlight
I need a car that drives itself completely automated and I want it for free and it needs infinite gas mileage.

Cheers,

Synthlight
tha Guardians is offline   Reply With Quote
Old 06-26-2009, 01:08 AM   #2
Izzy
Snek
FFR Simfile AuthorFFR Veteran
 
Izzy's Avatar
 
Join Date: Jan 2003
Location: Kansas
Age: 34
Posts: 9,192
Default Re: Need help with Javascript

I could do it in C#. If its syntax you are looking for I have no idea. If it pseudo code I could probably help.
Izzy is offline   Reply With Quote
Old 06-26-2009, 01:15 AM   #3
tha Guardians
MCDC 2011
FFR Veteran
 
tha Guardians's Avatar
 
Join Date: Nov 2006
Location: location, location~
Age: 84
Posts: 1,680
Send a message via AIM to tha Guardians Send a message via MSN to tha Guardians Send a message via Yahoo to tha Guardians
Default Re: Need help with Javascript

I would like to see it done in any language, but I'm looking for it in Javascript.

10,000 creds to someone that comes up with this.
__________________

Quote:
Originally Posted by sonic-fast-fingers View Post
can someone clarrify what QFT means my friend told me its quit ****ing talking, but im not 100 percent sure

Quote:
Originally Posted by Synthlight
I need a car that drives itself completely automated and I want it for free and it needs infinite gas mileage.

Cheers,

Synthlight
tha Guardians is offline   Reply With Quote
Old 06-26-2009, 01:19 AM   #4
Izzy
Snek
FFR Simfile AuthorFFR Veteran
 
Izzy's Avatar
 
Join Date: Jan 2003
Location: Kansas
Age: 34
Posts: 9,192
Default Re: Need help with Javascript

Well let me just explain how I think it should be done.

First use delimiters to seperate every word by a space and sort them into an array. Use some kind of substring method to take the first character and move it to the end of the word depending on the length of the word. Then for every word in the array just ad "ay" at the end. Then print them out using a loop to go through the array.
Izzy is offline   Reply With Quote
Old 06-26-2009, 01:24 AM   #5
tha Guardians
MCDC 2011
FFR Veteran
 
tha Guardians's Avatar
 
Join Date: Nov 2006
Location: location, location~
Age: 84
Posts: 1,680
Send a message via AIM to tha Guardians Send a message via MSN to tha Guardians Send a message via Yahoo to tha Guardians
Default Re: Need help with Javascript

Yes, but I don't want a loop or array. I want each function to be called on demand via a submit button.
__________________

Quote:
Originally Posted by sonic-fast-fingers View Post
can someone clarrify what QFT means my friend told me its quit ****ing talking, but im not 100 percent sure

Quote:
Originally Posted by Synthlight
I need a car that drives itself completely automated and I want it for free and it needs infinite gas mileage.

Cheers,

Synthlight
tha Guardians is offline   Reply With Quote
Old 06-26-2009, 01:26 AM   #6
Izzy
Snek
FFR Simfile AuthorFFR Veteran
 
Izzy's Avatar
 
Join Date: Jan 2003
Location: Kansas
Age: 34
Posts: 9,192
Default Re: Need help with Javascript

Why can't it do that with a submit button? It could just keep refreshing the text box you entered the original word in to be what the outcome is. Then spamming the submit button would further convert it into pig latin.
Izzy is offline   Reply With Quote
Old 06-26-2009, 01:31 AM   #7
tha Guardians
MCDC 2011
FFR Veteran
 
tha Guardians's Avatar
 
Join Date: Nov 2006
Location: location, location~
Age: 84
Posts: 1,680
Send a message via AIM to tha Guardians Send a message via MSN to tha Guardians Send a message via Yahoo to tha Guardians
Default Re: Need help with Javascript

Yeah, I guess that works. I just need the function to be called.
Javascript gives me brainpain

Okay, so the array isn't the part that's bugging me.
The part that's bugging me is retrieving strings from a text field and writing it to the page.

Any help there?
__________________

Quote:
Originally Posted by sonic-fast-fingers View Post
can someone clarrify what QFT means my friend told me its quit ****ing talking, but im not 100 percent sure

Quote:
Originally Posted by Synthlight
I need a car that drives itself completely automated and I want it for free and it needs infinite gas mileage.

Cheers,

Synthlight
tha Guardians is offline   Reply With Quote
Old 06-26-2009, 01:55 AM   #8
Squeek
let it snow~
Retired StaffFFR Veteran
 
Squeek's Avatar
 
Join Date: Jan 2004
Age: 37
Posts: 14,444
Send a message via AIM to Squeek
Default Re: Need help with Javascript

I was all ready to write up some code for this when I had a brain wave.

Surely someone else has written a Java program for pig latin, correct?

http://www.google.com/search?q=java+pig+latin

Oh hey, they have.
Squeek is offline   Reply With Quote
Old 06-26-2009, 01:57 AM   #9
Izzy
Snek
FFR Simfile AuthorFFR Veteran
 
Izzy's Avatar
 
Join Date: Jan 2003
Location: Kansas
Age: 34
Posts: 9,192
Default Re: Need help with Javascript

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    
    public partial class PigLatin : Form
    {
        public PigLatin()
        {
            InitializeComponent();
             
        }

        private void submit_Click(object sender, EventArgs e)
        {
            string temp = "";
            string word = textBox.Text;

                char[] delim = { ' ' };
                string[] stuff = word.Split(delim);

                for (int i = 0; i < stuff.Length; i++){
                temp = stuff[i];
                string letter = temp.Substring(0, 1);
                string part = temp.Substring(1, temp.Length - 1);
                stuff[i] = part + letter + "ay";

                   
               }

               textBox.Text = "";

                for (int k = 0; k > stuff.Length; k++)
                {

                    textBox.Text = textBox.Text + stuff[k];
                    textBox.Refresh();
                }

            
        }

        private void textBox_TextChanged(object sender, EventArgs e)
        {

        }

        private void PigLatin_Load(object sender, EventArgs e)
        {

        }
    }
}
This is what I came up with. For some reason it doesn't do anything and I'm to lazy to figure out why. It should work though.

Last edited by Izzy; 06-26-2009 at 02:00 AM..
Izzy is offline   Reply With Quote
Old 06-26-2009, 02:02 AM   #10
tha Guardians
MCDC 2011
FFR Veteran
 
tha Guardians's Avatar
 
Join Date: Nov 2006
Location: location, location~
Age: 84
Posts: 1,680
Send a message via AIM to tha Guardians Send a message via MSN to tha Guardians Send a message via Yahoo to tha Guardians
Default Re: Need help with Javascript

Well I'll be damned.
I'm look for Javascript, not Java, but I didn't even think of Google.

I stumbled across this site.
It's a little more advanced than what I'm going for, but it works great. Now if I can cipher through the code and make it rewrite to it's own text field then this should be easy.

Edit:

Izzy, if you can get that thing working completely and just send me a link or a copy of the source code I'll throw an extra 10k on top.
__________________

Quote:
Originally Posted by sonic-fast-fingers View Post
can someone clarrify what QFT means my friend told me its quit ****ing talking, but im not 100 percent sure

Quote:
Originally Posted by Synthlight
I need a car that drives itself completely automated and I want it for free and it needs infinite gas mileage.

Cheers,

Synthlight

Last edited by tha Guardians; 06-26-2009 at 02:08 AM..
tha Guardians is offline   Reply With Quote
Old 06-26-2009, 10:16 PM   #11
Izzy
Snek
FFR Simfile AuthorFFR Veteran
 
Izzy's Avatar
 
Join Date: Jan 2003
Location: Kansas
Age: 34
Posts: 9,192
Default Re: Need help with Javascript

www.bluexoon.com/Izzy/PigLatin.exe

Figured it out.

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void submit_Click(object sender, EventArgs e)
        {
            string temp = "";
            string word = textBox.Text;

            char[] delim = { ' ' };
            string[] stuff = word.Split(delim);

            for (int i = 0; i < stuff.Length; i++)
            {
                temp = stuff[i];
                string letter = temp.Substring(0, 1);
                string part = temp.Substring(1, temp.Length - 1);
                stuff[i] = part + letter + "ay";


            }

            textBox.Text = "";

            for (int k = 0; k < stuff.Length; k++)
            {

                textBox.Text = textBox.Text + stuff[k];
                if (k < stuff.Length - 1)
                {
                    textBox.Text = textBox.Text + " ";
                }
                textBox.Refresh();
            }

            

        }
    }
}
Apparently I accidentally used a greater than symbol instead of a less than. Had to fix one more thing after that since it didn't like have a space at the end of the word after it printed it out for the second run.
Izzy is offline   Reply With Quote
Old 06-26-2009, 11:18 PM   #12
tha Guardians
MCDC 2011
FFR Veteran
 
tha Guardians's Avatar
 
Join Date: Nov 2006
Location: location, location~
Age: 84
Posts: 1,680
Send a message via AIM to tha Guardians Send a message via MSN to tha Guardians Send a message via Yahoo to tha Guardians
Default Re: Need help with Javascript

Haha, this is great.
Not Javascript, but I'm having fun with it

Sending 15k
Tytyty
__________________

Quote:
Originally Posted by sonic-fast-fingers View Post
can someone clarrify what QFT means my friend told me its quit ****ing talking, but im not 100 percent sure

Quote:
Originally Posted by Synthlight
I need a car that drives itself completely automated and I want it for free and it needs infinite gas mileage.

Cheers,

Synthlight
tha Guardians is offline   Reply With Quote
Old 06-27-2009, 01:35 AM   #13
Izzy
Snek
FFR Simfile AuthorFFR Veteran
 
Izzy's Avatar
 
Join Date: Jan 2003
Location: Kansas
Age: 34
Posts: 9,192
Default Re: Need help with Javascript

Thanks, I didn't really take 15k credits worth of time though.
Izzy is offline   Reply With Quote
Old 06-27-2009, 07:32 PM   #14
tha Guardians
MCDC 2011
FFR Veteran
 
tha Guardians's Avatar
 
Join Date: Nov 2006
Location: location, location~
Age: 84
Posts: 1,680
Send a message via AIM to tha Guardians Send a message via MSN to tha Guardians Send a message via Yahoo to tha Guardians
Default Re: Need help with Javascript

I have over 600,000.
Doesn't matter.

Send some back if you'd like :P
__________________

Quote:
Originally Posted by sonic-fast-fingers View Post
can someone clarrify what QFT means my friend told me its quit ****ing talking, but im not 100 percent sure

Quote:
Originally Posted by Synthlight
I need a car that drives itself completely automated and I want it for free and it needs infinite gas mileage.

Cheers,

Synthlight
tha Guardians is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 10:48 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution