TIB: Novelties
[Prev][Next][Index][Thread]
TIB: Novelties
Hi, everyone!
I'm still trying to set up Aim to support wind, and now I just need a
few more finishing touches before I upload it to a home page, YES, a
home page. Before I finished, I just decided to play around with a few
other (theoretical) ideas on the TI-92:
1) Has anyone made a self-replicating program? Or a program that could
spontaneously create its own programs?
I have a simple program named 'replica' that takes its name as a
parameter. That is: replica("replica") DISCLAIMER: replica is
NOT considered a virus; thus far, viruses do not exist in BASIC
and is (in theory) impossible within the limitations of TI-BASIC.
At worst, this might be considered a Trojan, but it has yet to
crash or damage the calc in any way whatsoever.
Here's the program listing
(as usual, -> is the store command,
and /= is the inequality test)
:replica(self)
:Prgm
:Local self,x,y,t
:lbl top
:"" -> t
:rand(8) -> y
:For x,1,y
:t&char(rand(26)+96) -> t
:EndFor
:If gettype(#t) /= "NONE"
:goto top
:CopyVar #self,#t
:#t(t)
:EndPrgm
The parts before and including the For..EndFor loop are used to
create a 1-8 length string of lowercase characters, saved as 't'.
Then the program tests if there is a variable that happens to have a
name exactly like t. If not, it copys itself to that new variable
name and executes the copy. This is a very rudimentary program; if
you run it, keep it in a separate folder to make cleanup easy. This
program is quite limited, but it only took a matter of seconds to
write the first time.
2) Could a pair of linked TI-92s automatically determine a "host"
and "client" based on the order the communications started?
So far, this project has been unsuccessful and might even be
impossible, but it's a work in progress.
contact()
Prgm
Local t
Lbl top
Try
Try
0 -> t
SendCalc t
PxlText "Connected with host",1,1
2 -> t
Else
ClrErr
PxlText "Waiting for calc",1,1
GetCalc t
Text "Connection established",1,1
1 -> t
EndTry
Else
ClrErr
0 -> t
EndTry
0 -> ok
If t /= 0 Then
Return
Else
Dialog
Text " Connection failed!"
Text " Try again?"
EndDlog
EndIf
If ok=1
Goto top
0 -> t
EndPrgm
I just noticed when I typed that the program did not continue normally
when t=2, but I think the main problem is in the nested 'Try'
statements. More ideas are being formulated.
Tavis
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
Follow-Ups: