void.calc.org Contest: Pig Latin
Posted by Nick on 6 May 2000, 22:27 GMT
Ethay Oidvay Oductionspray esteredpay emay otay itewray anyay announcementyay aboutyay eirthay ewestnay ogrammingpray ontestcay. Inyay isthay, youay avehay otay itewray ayay ogrampray atthay anslatestray anyyay asephray intoyay igpay atinlay. Orfay oremay infoyay onyay atwhay igpay atinlay isyay, ogay eesay ethay Ialectizerday - it'syay atwhay eway usedyay otay oducepray artpay ofyay ouryay Aprilyay Ool'sfay okejay :)
|
|
|
The comments below are written by ticalc.org visitors. Their views are not necessarily those of ticalc.org, and ticalc.org takes no responsibility for their content.
|
|
Re: void.calc.org Contest: Pig Latin
|
skyraid
|
does anyone know if there is like a program that can translate tibasic into asm? i saw a program that did it with machine langue or something... i was just wondering because a while back i made a pig latin translator.. later
- skyraid
|
|
7 May 2000, 07:53 GMT
|
|
Re: void.calc.org Contest: Pig Latin
|
Nick Disabato
(Web Page)
|
I'm at a LAN party all night right now. It's about 3:00 AM here in Chicago and, yes, I have AP tests this week, 200 pages of a book to read, and I have to visit relatives tomorrow.
Yeah, it's been a little bit busy. Thanks for asking.
I got rid of some offending comments (i.e. people who feel they need to resign their inevitable fate by saying they didn't get first comment when they really did and I deleted it :P)
Sorry that I didn't get to this earlier. Needless to say; I've been bowling, eating dinner, eating pie, playing You Don't Know Jack 3, eating more dinner and more pie, and some other stuff today that best goes unmentioned *g*.
Things will get back on track in a fortnight or so when I won't need to worry about any of this AP test garbage anymore and all I need to do is attend some 9e99 graduation parties.
In short, yes I'm still here and I haven't dropped off the face of the earth :)
--BlueCalx
|
|
7 May 2000, 09:58 GMT
|
|
|
|
|
|
|
|
Re: Re: Re: void.calc.org Contest: Pig Latin
|
Jeff Meister
|
MSPAP's are corrupted. Just thought I'd rant for a while here:
The @&@!ing teachers tell us this test counts for your grade and will get you into smart courses in high school. They're lying as usual... this test is only to evaluate the school, and personal scores aren't even obtainable (actually I think a parent can call and get them if they care all that much). They only tell us this because if we don't try on the test and think it doesn't count, we get to be 3rd from the bottom in the county like last year and they all lose their jobs! They have no idea how much power we hold over them! Mwahahaha!
Boy did I piss off the English teacher. We were discussing MSPAP testing as usual in that class, and the teachers were stressing how important it is for us to be in school that day (they even have prizes for people who show up). I once again screwed her up by saying that the only reason the teachers and stuff want us to come to school is because if we don't, WE GET A 0 FOR THE TEST. Why you ask? Because the teachers and administrators are so corrupted here. If that rule wasn't in place, the teachers would tell all the stupid kids to stay home so the scores go up! Boy did she get pissed. Paul said to me in a whisper that I'm positive she could hear, "Jeff! Don't tell the truth! She can't take it!"
Hahaha... in my testing group today I was done before everyone else except Mike Moor, who was sitting right across from me. He wanted to play with my TI-89, so I let him. I started working on my TI-83, on my Pig-Latin program. Yay, that makes this all on-topic! Or not. But anyway, Mrs. Unger comes over and screams (kind of) Jeff! Mike! gimme those calculators, and get back to work on your test! Then we both say, but Mrs. Unger, we're done! WELL GET BACK TO WORK ANYWAY! YOU WILL FIND A WAY TO WORK! REREAD EVERYTHING 500 TIMES!
Testing sucks.
- Jeff
|
|
9 May 2000, 22:23 GMT
|
|
Re: void.calc.org Contest: Pig Latin
|
William Tipton
|
i think a good contest would be for a program that simplifies radicals..
i know there is already one in the archives for the 83 but its over 1000 bytes and i think we can do better than that ;-)
|
|
7 May 2000, 21:44 GMT
|
|
ASM
|
Gohan
(Web Page)
|
ok i know off the subject but I still dont get this ASM compiling thing, I'm trying to use as92 (the on calc compiler) but how does it work? there are no instructions:( besides, if I wrote an asm program in notepad how would I get it on my ti89 so I can compile it? it allways annoys me by saying not individual!!
|
|
7 May 2000, 21:55 GMT
|
|
|
|
|
Re: ASM
|
JrJinfinity
(Web Page)
|
Maybe you should try compiling on the PC instead, then test the programs using an emulator, I find they compile lots faster on the PC, and the emulator is faster or not depending on your settings. Also if you crash the emulator you can with 1 click revert to the saved state this saves much time in testing programs, and much battery life as well.
I haven't ever seen a descent compiler for the computer that didn't have descent documentation either, they are pretty good about that to keep it simple for others to use their programs.
BTW, when will Ti-85's ever get a featured program, they've never had one, and maybe never will? If you look there are excellent programs coming out for them still, just not as fast as for the other calcs.
-JrJinfinity
|
|
8 May 2000, 03:05 GMT
|
|
Re: void.calc.org Contest: Pig Latin
|
luke195rs
|
Wait a minute, I thought that in pig latin you moved the first letter to the end FIRST, and THEN added an A... or am I just crazy.
By the way, I think that creating a program like this for a contest is a very nice idea.
|
|
8 May 2000, 04:57 GMT
|
|
Help!
|
Jeff Meister
|
I'm sure someone knows how to do this, so might as well post it here... I'm working on this pig-latin program in TI-83 BASIC (just for fun) and I'm stuck with something...
I already got the program to figure out where the first vowel is (using inString). Actually, it knows where all the vowels are, but that doesn't matter. What I can't seem to get it to do is remove the letters before the vowel. I tried:
sub(Str1,1,X)
Where X is the position of the first vowel in the string minus one. That gives me an error because sub doesn't seem to like variables. It doesn't like list items either, I tried it with L1(1) and got an error. If anyone knows how I could fix this, or a better way to do it... please respond.
Thanks,
- Jeff
|
|
9 May 2000, 22:05 GMT
|
|
|
|
|
Re: Help!
|
luke195rs
|
I'm not exactly sure, but have you tryed something like this?
sub(Str1,1,inString(Str1,"A",1))
I mean that you don't ever have to store it as a variable if you substitue your inString statement into the sub statement itself. I really have no idea how to make a pig-latin program because, the pig-latin I learned is different than ticalc.org's. Let me know if this helps at all. I usually try to avoid strings when possible because to me the syntax makes little sense, and I ALWAYS end up looking in the manual. That, and the calc lacks the tools, I think are nessesary to work with strings. One major problem I encountered is adding a variable to the end of a string. If I wanted to add Z to a string if Z was, oh say 85, I would think I would do this...
85->Z
"ABCDE"->Str1
Str1+Z->Str1
... to get "ABCDE85", but it doesn't work. I can't find anything like this in the manual. Is there a way to do do this?
|
|
10 May 2000, 05:34 GMT
|
|
|
|
|
|
|
|
Re: Re: Help!
|
Daniel Bishop
|
Str1+Z -> Str1
You can't add a numeric variable to a string like that. It doesn't work. However, you can add a one-digit number to the end of a string like this:
Str1+sub("0123456789",Z+1,1) -> Str1
You'll need to add the digits one by one. If you know Z is an integer between 10 and 99, you could use:
Str1+sub("0123456789",int(Z/10)+1,1) + sub("0123456789",fPart(Z/10)*10+1,1) -> Str1
You'll probably want to store "0123456789" in another string variable if you're going to use it a lot. Also, it would help to write a program that turns large integers into lists (for example: 21095 to {2,1,0,9,5}) to simplify the number-to-string code.
I wish the 83 had a str$ function like QBasic. It would make my programs so much easier to write.
|
|
11 May 2000, 03:10 GMT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Re: Re: Re: Re: Help!
|
EvanMath
|
If by "separate the digits in a large integer" you mean just take a number (not a string) and put the digits in a list, I think I have the fastest and smallest way. (This is intended for TI-83, but it should be easy to convert it to other calcs.
ipart(10fPart(N/seq( <10^(>X),X,1,1+log(N))))
Drop the space after seq( (stupid 40 character rule).
You can (and should) drop of the parenthises at the end of the line if you can, and <10^(> is the 10^X, which is right above the log key on TI-83. When you drop the closing parenthises, it is 19 bytes, and all one line.
|
|
13 May 2000, 17:35 GMT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Re: Re: Re: Re: Help!
|
Daniel Bishop
|
I've written a routine to convert any real number to a string. It's slow, but I'm sure someone will make a better one.
PROGRAM:STR
// precondition: X is a real number
// postcondition: Str1=str$(X)
// check whether X is positive or negative
0 -> N
If X<0
Then
-X -> X // If negative, change to + temporarily
1 -> N // and set negative flag
End
// Create a new string
// Start with decimal point
"." -> Str1
// separate integer part from fraction part
iPart(X) -> I
fPart(X) -> F
// Add integer's digits, one at a time,
// to the left side
While I>0
10fPart(I/10) -> D
iPart(I/10) -> I
sub("0123456789",D+1,1)+Str1 -> Str1
End
If F
// If there is a fractional part,
// add its digits to the end of Str1
While F>0
iPart(10F) -> D
fPart(10F) -> F
Str1+sub("0123456789",D+1,1) -> Str1
End
// if not, remove the decimal point
Else
sub(Str1,1,length(Str1)-1) -> Str1
End
// if x was negative, add a minus sign
If N
"-"+Str1 -> Str1
|
|
16 May 2000, 06:24 GMT
|
|
|
|
|
|
|
|
Re: Re: Help!
|
Jeff Meister
|
Hmm, maybe you were in a different situation, let me explain mine and see if it's the same.
When I'm making a program (TI-BASIC) to convert Engilsh to Pig Latin, I need to know where the first vowel is. So I use inString( to find the locations of all the vowels, delete the ones that don't exist (equal 0) and stick them in a string. Then I sort the string in ascending order with SortA( and that should tell me the position of the first vowel. Let's say that (or actually, that minus one) is stored to X.
Now I want to get rid of the stuff before that vowel and put it at the end. So to get rid of it, I did:
sub(Str1,1,X) -> Str2
So that should take out everything before the vowel. But it doesn't. For some reason, that gives me an error, I think it was Domain or Data Type. That's my main problem.
If that were to work, then it would be simple, I just do:
Str2 + "AY" -> Str2
Str1 + Str2 -> Str1
I have no idea why this happens. I'm going to look up sub( and inString( in the manual to see if I'm doing something wrong.
- Jeff
P.S. By the way... are you using a TI-83? That's the calculator I'm doing this on, maybe I forgot to say that.
|
|
11 May 2000, 21:42 GMT
|
|
|
|
|
Re: Help!
|
Marius from the Netherlands
|
Sub argumeents go like this: sub(string number,number of first letter u want,number of letters you want)
so u would need:
sub(Str1 ,X,length( Str1)-X)->Str2
the X should NOT be minus one...
just the normal X which is the place of the vowel
what it does is this: it takes from Str1 the piece:X to the length of string one -X, which will get exactly to the end. Then it stores that piece in Str2
if Str1 is brother and X is 2, it takes 2 to 7-2 (=5)
Your full code will be like this:
"Your code to figure out where the first vowel is and that is stored in X"
:If X=1
:Then
:Str1+ "YAY"->Str1
:Goto AA
:End
:sub( Str1,X,length( Str1)-X)->Str2
:sub(Str1,1 ,X-1)->Str3
:Str2 +Str3+"AY"->Str1
:Lbl AA
:disp Str1
btw guys, im reeally stunned noone knew how to do that..... i think im a bit late with my response, but ow well..... i dont really care
|
|
21 November 2003, 23:02 GMT
|
|
1 2 3 4
You can change the number of comments per page in Account Preferences.
|