there is a difference between impractical and pointless Smile
It is IMPRACTICAL to waste time on a POINTLESS program Very Happy
Pseudoprogrammer wrote:
The impractical part is....

ITS NOT IMPRACTICAL!!!!
It's not impractical, doing it is.
Pseudoprogrammer wrote:
It's not impractical, doing it is.


I can do it in an hour or less... That is the worst arugment I have ever heard (not really, but close...)
... You are really not getting it. The program is pointless, so it is impractical to waste your said hour on a pointless endeavor when you could be doing something useful.
Hey pseudo - have you ever coding something completely pointless just to see if you could or to figure out how to do it? If so, then shut the hell up. If not, why not?

Its a stupid program, but for the experience it may be worth it - although it would be better experience to do it in a real programming language (aka, one for the PC, be it C/C++, python, java, c#, lua, etc...)
Part of the point (maybe the whole point) of coding some useless is to have fun and/or show you're capable of it. Razz
Its an exercise in creative thinking Very Happy
Quote:
I just need something to convert numbers to a string, I will end up programming an if x=5 "5->str1


I know of a routine that does put the value of a variable into a string.

number -> X
{X,0 -> L1
{0,X -> L2
LinReg(ax+b) L1,L2,Y1
Equ>Str Y1,Str1
Sub(Str,5,length(str1)-4 -> Str1
It works, but when I ran it the first time it cleared my ram, than I retyped it and it worked... Rolling Eyes


I lost the version I spent 10 minutes on, but I can remake it easily now Smile
That also happened to me the first time I used it, but it works fine now. Stupid TIOS Razz
Here is a one I worked on the past few days in the few minutes between classes:

http://rapidshare.com/files/59883378/Associate.zip.htm

The readme says it all:

Quote:
Experimental program by David Dohan AKA Harq

I made this after the discussion in the topic about that AI. While this is not AI, it shows a simple way to associate things in basic. Right now it only has the answering questions, not accepting answers, but you can edit the program (at the beginning, the string1 value and lists 1 and 2)

NOTE : It uses strings up to 6 (or 5, not sure)

The format for string 1 is:
":1:Harq:2:The Programmer:3:life:4:highway:5:rollercoaster
Than for list 1 and 2:

L1 = {1,2,2
L2 = {2,4,4

From this if you typed in :
"Who (or what) is Harq?"
it would print out
The Programmer

If you typed in "What is life?"
it would display
Highway
Rollercoaster


It uses the numbers to figure out where the heck it is, and also what it is associated to. Don't look at the source, there are so many nested string commands (length, sub, instring) that it will make your eyes bleed =P

This is just a simple demonstration, mainly for myself but I thought I would share =)
Pseudoprogrammer wrote:
Quote:
I just need something to convert numbers to a string, I will end up programming an if x=5 "5->str1


I know of a routine that does put the value of a variable into a string.

number -> X
{X,0 -> L1
{0,X -> L2
LinReg(ax+b) L1,L2,Y1
Equ>Str Y1,Str1
Sub(Str,5,length(str1)-4 -> Str1

MEh mine is better it works with real and Imag numbers Smile


Code:
:real(A
:{ans,ans->L3
:{0,1->L4
:LinReg(a+bx) L3,L4,Y0
:Equ>String Y0,Str1
:Sub(Str1,1,length(str1)-3 -> Str1
:imag(a
:If ans
:Then
:{ans,ans->L3
:{0,1->L4
:LinReg(a+bx) L3,L4,Y0
:Equ>String Y0,Str2
:Sub(Str2,1,length(str2)-3 -> Str2
:str1+"+"+str2+"[i]i[/i] -> str1
:Delvar str2
:End
:Delvar Y0DelvarL3DelvarL4

It also shows all 11 bytes of precision that the calcs use. Smile
Its also twice as long and I don't need imaginary numbers (what, you think I will be putting imaginary numbers into strings? wtf?)
Well I was making it for Zcalc so I want imaginary number support. If you don't want imaginary support then you only need the first half then(every thing before the Imag(A ) but that is basicly the same code maybe a byte smaller
Edit: just use this it is the smallest code I can get to.

Code:
:{0,1->L1
:{x,x->L2
:LinReg(a+bx) Y1
:Equ>String Y1,str1
:sub(str1,1,length(str1)-3 ->str1
Would someone please tell me what they think of the experimental program I made? It has absolutely no grasp of grammar and requires an is after the who or what, but it still was interesting Smile
Harq wrote:
Would someone please tell me what they think of the experimental program I made? It has absolutely no grasp of grammar and requires an is after the who or what, but it still was interesting Smile
Would work fine as far as I can see. It's like Simms' mentally challenged great-grandfather. Very Happy
It was originally a bit shorter, but it HAD to have a 2 digit number for in the string, I made it so it can basically go out to as far as I want (default is 4 or 5 digits, I forgot)


I will probably add the ability to tell it stuff sometimes next week (Not this week, I get Friday and Monday off!!!!!!!! =) )
It sounds Like a cool idea almost like a Simms ai in ti basic, except better :p
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement