Posted by: computoman | November 4, 2009

Just a Quick note again.

I did not get out the four sound card system out on time because of other work. I still plan to finish that project as well as the others mentioned in an earlier blog. Please bear with me.

Posted by: computoman | November 4, 2009

Some peoples thoughts on open source.

edited….

Post A few reasons I prefer open source

A few months ago, I wrote up an article on why I use open source software. It may be of interest here. It’s kind of lengthy to post in its entirety here, but a teaser follows.
Quote:
While I am not opposed to closed source or proprietary software, as others may be, I very much appreciate software that is open source. I view it as a feature: a very attractive feature that can be implemented in any piece of software.

And the short list is

* No malware
* Clean uninstalls
* Good learning tool for early programmers
_________________

Sun Nov 01, 2009 5:02 am

Joined: Wed Aug 26, 2009 5:30 am
Posts: 82

Post Re: A few reasons I prefer open source
f wrote:
A few months ago, I wrote up an article on why I use open source software. It may be of interest here. It’s kind of lengthy to post in its entirety here, but a teaser follows.
Quote:
While I am not opposed to closed source or proprietary software, as others may be, I very much appreciate software that is open source. I view it as a feature: a very attractive feature that can be implemented in any piece of software.

And the short list is

* No malware
* Clean uninstalls
* Good learning tool for early programmers

Open source is just as likely to contain malware if not more lilely than closed source. All it takes is some Dbag getting a hold of it injecting it with nasties then redistributing the program. Where as with closed source only the developer that holds the code can do this.

Sun Nov 01, 2009 6:07 pm

Joined: Sun May 04, 2008 11:34 pm
Posts: 505
Location: Tampa, FL, USA

Post Re: A few reasons I prefer open source
Not true. It is just as easy to add malicious code to a program if you have only a binary or if you have the source. What is difficult, though, is distributing that source with the malware in it. People will see it there plain as day.

_________________

Sun Nov 01, 2009 6:30 pm

Post Re: A few reasons I prefer open source
thatoneguy wrote:
ShawnJGoff wrote:
A few months ago, I wrote up an article on why I use open source software. It may be of interest here. It’s kind of lengthy to post in its entirety here, but a teaser follows.
Quote:
While I am not opposed to closed source or proprietary software, as others may be, I very much appreciate software that is open source. I view it as a feature: a very attractive feature that can be implemented in any piece of software.

And the short list is

* No malware
* Clean uninstalls
* Good learning tool for early programmers

Open source is just as likely to contain malware if not more lilely than closed source. All it takes is some Dbag getting a hold of it injecting it with nasties then redistributing the program. Where as with closed source only the developer that holds the code can do this.

I’ve never heard of malware for Linux. Unless it’s runs in wine. There are plenty for windows though.

I like open source because it’s free as in I don’t have to pay for any of it.

And most bugs get fixed almost instantly in comparison to proprietary which can take years or never be fixed if it’s not supported any longer. That’s one of the bad things about proprietary, once the business is sold or out of business the code is dead and the programs are useless. But with open source it’s always available to be modified and preserved.

I also like how because it’s open there is so much support for it from community and I mean most every project. And proprietary you would have to pay for support or have to wait on the phone or find a post with your question and they want to charge you for the answer. hahahaha

Also, the no viruses thing is pretty great.

I really like how windows machines get really slow as you use them. That’s not a “pro open source” but I think it’s great.

I would also say that Open Source products generally work better than proprietary. At least in my experience. Though I’ve not used proprietary in a very very long time. But I do have LinDVD on my system. Actually, now that I think of it, I’ve never seen “LinDVD update available”. So the update thing is a good reason to use OpenSource. And because they’re usually improvements and not just new ways to force advertising onto the users like in a lot of cases with proprietary.

_________________

Sun Nov 01, 2009 11:08 pm

Joined: Wed Aug 26, 2009 5:30 am
Posts: 82

Post Re: A few reasons I prefer open source
ShawnJGoff wrote:
Not true. It is just as easy to add malicious code to a program if you have only a binary or if you have the source. What is difficult, though, is distributing that source with the malware in it. People will see it there plain as day.

My point was one is not safer than the other and to think so is pretty ignorant. Its easier to inject a program with nasties when you have the source and know how the program is compiled etc. how could you even argue that? open source is easier to make changes to, thats the freaking point of open source!

Nobody said anything about distributing the source with malware.

Just as a reference it would be 100000x easier to inject malware into pidgin and redistribute it than it would be to use msn messenger or yahoo messenger.

Thinking opensource is inherently more secure than closed source is a flawed idea at the very core.

Quote:
I’ve never heard of malware for Linux. Unless it’s runs in wine. There are plenty for windows though.

I dont seen anybody mentioning platforms here.

Dont get me wrong i prefer open source to closed mostly because of the reasons MattKing mentioned, Faster updates, better support etc. but the “its safer” claim is nonsense that has been thrown aroudn for some time.

Mon Nov 02, 2009 3:35 pm

Joined: Sun May 04, 2008 11:34 pm
Posts: 505
Location: Tampa, FL, USA

Post Re: A few reasons I prefer open source
It is trivial to patch a binary with a loader that executes whatever arbitrary code you produce then jumps to the first instruction of the original program. In fact, there are automated tools out there for doing just that. Any untrusted distributor of software can be serving up trojanized software – it doesn’t matter if it’s closed or open. Having the source doesn’t change that one bit.

Where I’m concerned is with the authors (not necessarily the distributors) of the software. Say someone advertises a cool program that keeps a super-encrypted database of all your passwords that you can carry around on your thumb drive. It lets you use a different arbitrarily complex password on all your websites because you don’t have to remember them. Pretty cool tool, but there’s no way in hell I’m going to use it if the source is not openly published right along with the binary – who knows what the authors of the program actually wrote.

For an open source program, if the software is at all popular, people have read the source code. If there is malware in it, people will know pretty quickly. At that point, either the program dies of obscurity or someone makes a clean version and that becomes the one people know and love. Closed source software takes much more skill and time to analyze.

_________________

Mon Nov 02, 2009 5:50 pm

Joined: Thu May 15, 2008 4:32 am
Posts: 598
Location: Dallas TEXAS

Post Re: A few reasons I prefer open source
Oh sorry, I try to mention platforms any chance I get because windows is terrible and Linux isn’t terrible. That’s all that I was saying. :) But, I’ve never heard of open source malware either. That may be a cool project to start though.

_________________

Mon Nov 02, 2009 8:03 pm

Joined: Wed Aug 26, 2009 5:30 am
Posts: 82

Post Re: A few reasons I prefer open source
f wrote:
It is trivial to patch a binary with a loader that executes whatever arbitrary code you produce then jumps to the first instruction of the original program. In fact, there are automated tools out there for doing just that. Any untrusted distributor of software can be serving up trojanized software – it doesn’t matter if it’s closed or open. Having the source doesn’t change that one bit.

Where I’m concerned is with the authors (not necessarily the distributors) of the software. Say someone advertises a cool program that keeps a super-encrypted database of all your passwords that you can carry around on your thumb drive. It lets you use a different arbitrarily complex password on all your websites because you don’t have to remember them. Pretty cool tool, but there’s no way in hell I’m going to use it if the source is not openly published right along with the binary – who knows what the authors of the program actually wrote.

For an open source program, if the software is at all popular, people have read the source code. If there is malware in it, people will know pretty quickly. At that point, either the program dies of obscurity or someone makes a clean version and that becomes the one people know and love. Closed source software takes much more skill and time to analyze.

You completely missed the point of everything i said and went right back to the whole malware in the source thing.

Mon Nov 02, 2009 10:22 pm

Joined: Sun May 04, 2008 11:34 pm
Posts: 505
Location: Tampa, FL, USA

Post Re: A few reasons I prefer open source
y wrote:
You completely missed the point of everything i said and went right back to the whole malware in the source thing.

I directly addressed what you said.
y wrote:
All it takes is some Dbag getting a hold of it injecting it with nasties then redistributing the program. Where as with closed source only the developer that holds the code can do this.
I directly addressed this when I said
ShawnJGoff wrote:
It is just as easy to add malicious code to a program if you have only a binary or if you have the source.

You then said the exact same thing again, so I elaborated…
thatoneguy wrote:
Its easier to inject a program with nasties when you have the source and know how the program is compiled etc. how could you even argue that?
My response was that it’s not, and I clarly explained why: there are automated tools for injecting payloads into binary executables.

I might add that because of this, it may actually be even easier to attach something to a binary than to try to mess around with the code. You don’t even have to know how to program: you just get a kit, (they usually come with a virus), and use the tool to attach it to a program. Thus it is just as easy to distribute infected binaries of open source software as it is closed source. Your argument is nullified: it is not more difficult to infect binaries than to infect source.

thatoneguy wrote:
My point was one is not safer than the other and to think so is pretty ignorant.
Now you’re missing my point. I stated in the original article and reiterated here that the security with open source software is with the intentions of the developer of the software. With open source software, everyone can see it and know what it does. With closed source software, the developer can say it does one thing, when it actually does something else, and it’s much harder for people to catch.

Imagine you are a malicious developer. You want to spread your virus out there by including it in a useful tool. Now, are you going to release the code with it? Certainly not! If you do, someone will see the malicious code pretty readily – it is better to conceal it.

_________________

Tue Nov 03, 2009 3:52 am

Joined: Sun May 04, 2008 9:57 pm
Posts: 1200

Post Re: A few reasons I prefer open source
if you know hardware and understand machine code and or assembly, any software can become compromised. Most people do not invest the time to do that anymore except maybe people who work with embedded devices. There are a variety of decompilers which can help in extracting source code for application programs which then can be recompiled for what ever use. That being said I do run a rootkit checker on occasion.

My reasons for running “true” open source are several.
1. With all the systems we have, using a proprietary system would be cost prohibitive via vendor lock-in.
2. Open source so far has done an excellent job in still supporting the older hardware we have. We do not have to upgrade every ten minutes.
3. Linux is reasonably secure when precautions are taken.
4. Except in certain niches, there is a larger variety of software available for open source than in the proprietary world.
5. Having started out as a maintenance programmer, I love that I can acquire source code and modify it for my needs. Everything does not have to be built from scratch though I do have the freedom and tools to do that..
6. There are no limitations on how I setup and or modify my hardware, A proprietary vendor can not limit me to what I attach to a system. (i.e memory in a nettop)
7. No need to have to worry about keeping product key codes. I avoid software that does. I can load the os and most apps on as many machines as I want.
8. No need for the most part have to have a compartmentalized os where I need special software install for a particular purpose. (i;e;You can easily turn a server into a desktop and or a desktop into a server without reinstalling the os).
9. Easier access to applications and operation systems without have to deal with shrink wrapped media available only from a retail establishment.. You can try it before you buy it.

Just a few reasons.

Joined: Sun May 04, 2008 11:34 pm
Posts: 505
Location: Tampa, FL, USA

Post Re: A few reasons I prefer open source
Yeah, anti-piracy efforts are part of the reason I moved full-time to Linux. The stupid XP activation thing pisses me off. The first time I had to call Microsoft to ask them to let me please install the software I payed for on the machine I payed for, I was out.

y wrote:
This is my point…

Take open source program, inject with nasties, redistribute without source.

Doing that is just as easy if not easier than doing the same to a closed source program and just as easy to conceal.

Yes, I understand your point. I still say it is just as easy to infect a closed source as an open source since it’s easier to infect a binary than source. But to only consider the danger from redistributors of software (as you are doing) is foolish. There lies a problem at the origin. Remember the Gator program? It was a tool to automatically fill in website forms. The problem is, it spied on you. This program would never have gotten out (at least without the spyware removed) if it was open source.

Consider Windows – a complex closed-source application. I can download it straight from the developer – not through a 3rd party distributor – and it still could contain spyware. Now imagine Ubuntu tried the same thing – it would be found out immediately: either because the source code showed the malware readily or because people can’t get the code to compile to the binary their serving.

How can you ignore this issue

Posted by: computoman | October 30, 2009

Reprint: Richard Stallman on open source.

Why Open Source misses the point of Free Software

by Richard Stallman

When we call software “free,” we mean that it respects the users’ essential freedoms: the freedom to run it, to study and change it, and to redistribute copies with or without changes. This is a matter of freedom, not price, so think of “free speech,” not “free beer.”

These freedoms are vitally important. They are essential, not just for the individual users’ sake, but for society as a whole because they promote social solidarity—that is, sharing and cooperation. They become even more important as our culture and life activities are increasingly digitized. In a world of digital sounds, images, and words, free software becomes increasingly essential for freedom in general.

Tens of millions of people around the world now use free software; the schools of regions of India and Spain now teach all students to use the free GNU/Linux operating system. Most of these users, however, have never heard of the ethical reasons for which we developed this system and built the free software community, because nowadays this system and community are more often spoken of as “open source,”, attributing them to a different philosophy in which these freedoms are hardly mentioned.

The free software movement has campaigned for computer users’ freedom since 1983. In 1984 we launched the development of the free operating system GNU, so that we could avoid the nonfree operating systems that deny freedom to their users. During the 1980s, we developed most of the essential components of the system and designed the GNU General Public License (GNU GPL) to release them under—a license designed specifically to protect freedom for all users of a program.

Not all of the users and developers of free software agreed with the goals of the free software movement. In 1998, a part of the free software community splintered off and began campaigning in the name of “open source.” The term was originally proposed to avoid a possible misunderstanding of the term “free software,” but it soon became associated with philosophical views quite different from those of the free software movement.

Some of the supporters of open source considered the term a “marketing campaign for free software,” which would appeal to business executives by highlighting the software’s practical benefits, while not raising issues of right and wrong that they might not like to hear. Other supporters flatly rejected the free software movement’s ethical and social values. Whichever their views, when campaigning for open source, they neither cited nor advocated those values. The term “open source” quickly became associated with ideas and arguments based only on practical values, such as making or having powerful, reliable software. Most of the supporters of open source have come to it since then, and they make the same association.

Nearly all open source software is free software. The two terms describe almost the same category of software, but they stand for views based on fundamentally different values. Open source is a development methodology; free software is a social movement. For the free software movement, free software is an ethical imperative, because only free software respects the users’ freedom. By contrast, the philosophy of open source considers issues in terms of how to make software “better”—in a practical sense only. It says that nonfree software is an inferior solution to the practical problem at hand. For the free software movement, however, nonfree software is a social problem, and the solution is to stop using it and move to free software.

“Free software.” “Open source.” If it’s the same software, does it matter which name you use? Yes, because different words convey different ideas. While a free program by any other name would give you the same freedom today, establishing freedom in a lasting way depends above all on teaching people to value freedom. If you want to help do this, it is essential to speak of “free software.”

We in the free software movement don’t think of the open source camp as an enemy; the enemy is proprietary (nonfree) software. But we want people to know we stand for freedom, so we do not accept being mislabeled as open source supporters.
Common Misunderstandings of “Free Software” and “Open Source”

The term “free software” is prone to misinterpretation: an unintended meaning, “software you can get for zero price,” fits the term just as well as the intended meaning, “software which gives the user certain freedoms.” We address this problem by publishing the definition of free software, and by saying “Think of ‘free speech,’ not ‘free beer.’” This is not a perfect solution; it cannot completely eliminate the problem. An unambiguous and correct term would be better, if it didn’t present other problems.

Unfortunately, all the alternatives in English have problems of their own. We’ve looked at many that people have suggested, but none is so clearly “right” that switching to it would be a good idea. (For instance, in some contexts the French and Spanish word “libre” works well, but people in India do not recognize it at all.) Every proposed replacement for “free software” has some kind of semantic problem—and this includes “open source software.”

The official definition of “open source software” (which is published by the Open Source Initiative and is too long to include here) was derived indirectly from our criteria for free software. It is not the same; it is a little looser in some respects, so open source supporters have accepted a few licenses that we consider unacceptably restrictive of the users. Nonetheless, it is fairly close to our definition in practice.

However, the obvious meaning for the expression “open source software”—and the one most people seem to think it means—is “You can look at the source code.” That criterion is much weaker than the free software definition, much weaker also than the official definition of open source. It includes many programs that are neither free nor open source.

Since that obvious meaning for “open source” is not the meaning that its advocates intend, the result is that most people misunderstand the term. According to writer Neal Stephenson, “Linux is ‘open source’ software meaning, simply, that anyone can get copies of its source code files.” I don’t think he deliberately sought to reject or dispute the “official” definition. I think he simply applied the conventions of the English language to come up with a meaning for the term. The state of Kansas published a similar definition: “Make use of open-source software (OSS). OSS is software for which the source code is freely and publicly available, though the specific licensing agreements vary as to what one is allowed to do with that code.”

The New York Times has run an article that stretches the meaning of the term to refer to user beta testing—letting a few users try an early version and give confidential feedback—which proprietary software developers have practiced for decades.

Open source supporters try to deal with this by pointing to their official definition, but that corrective approach is less effective for them than it is for us. The term “free software” has two natural meanings, one of which is the intended meaning, so a person who has grasped the idea of “free speech, not free beer” will not get it wrong again. But the term “open source” has only one natural meaning, which is different from the meaning its supporters intend. So there is no succinct way to explain and justify its official definition. That makes for worse confusion.

Another misunderstanding of “open source” is the idea that it means “not using the GNU GPL.” This tends to accompany another misunderstanding that “free software” means “GPL-covered software.” These are equally mistaken, since the GNU GPL is accepted as an open source license and most of the open source licenses qualify as free software licenses.
Different Values Can Lead to Similar Conclusions…but Not Always

Radical groups in the 1960s had a reputation for factionalism: some organizations split because of disagreements on details of strategy, and the two daughter groups treated each other as enemies despite having similar basic goals and values. The right wing made much of this and used it to criticize the entire left.

Some try to disparage the free software movement by comparing our disagreement with open source to the disagreements of those radical groups. They have it backwards. We disagree with the open source camp on the basic goals and values, but their views and ours lead in many cases to the same practical behavior—such as developing free software.

As a result, people from the free software movement and the open source camp often work together on practical projects such as software development. It is remarkable that such different philosophical views can so often motivate different people to participate in the same projects. Nonetheless, there are situations where these fundamentally different views lead to very different actions.

The idea of open source is that allowing users to change and redistribute the software will make it more powerful and reliable. But this is not guaranteed. Developers of proprietary software are not necessarily incompetent. Sometimes they produce a program that is powerful and reliable, even though it does not respect the users’ freedom. Free software activists and open source enthusiasts will react very differently to that.

A pure open source enthusiast, one that is not at all influenced by the ideals of free software, will say, “I am surprised you were able to make the program work so well without using our development model, but you did. How can I get a copy?” This attitude will reward schemes that take away our freedom, leading to its loss.

The free software activist will say, “Your program is very attractive, but I value my freedom more. So I reject your program. Instead I will support a project to develop a free replacement.” If we value our freedom, we can act to maintain and defend it.
Powerful, Reliable Software Can Be Bad

The idea that we want software to be powerful and reliable comes from the supposition that the software is designed to serve its users. If it is powerful and reliable, that means it serves them better.

But software can be said to serve its users only if it respects their freedom. What if the software is designed to put chains on its users? Then powerfulness means the chains are more constricting, and reliability that they are harder to remove. Malicious features, such as spying on the users, restricting the users, back doors, and imposed upgrades are common in proprietary software, and some open source supporters want to implement them in open source programs.

Under pressure from the movie and record companies, software for individuals to use is increasingly designed specifically to restrict them. This malicious feature is known as Digital Restrictions Management (DRM) (see DefectiveByDesign.org and is the antithesis in spirit of the freedom that free software aims to provide. And not just in spirit: since the goal of DRM is to trample your freedom, DRM developers try to make it hard, impossible, or even illegal for you to change the software that implements the DRM.

Yet some open source supporters have proposed “open source DRM” software. Their idea is that, by publishing the source code of programs designed to restrict your access to encrypted media and by allowing others to change it, they will produce more powerful and reliable software for restricting users like you. The software would then be delivered to you in devices that do not allow you to change it.

This software might be open source and use the open source development model, but it won’t be free software since it won’t respect the freedom of the users that actually run it. If the open source development model succeeds in making this software more powerful and reliable for restricting you, that will make it even worse.
Fear of Freedom

The main initial motivation of those who split off the open source camp from the free software movement was that the ethical ideas of “free software” made some people uneasy. That’s true: raising ethical issues such as freedom, talking about responsibilities as well as convenience, is asking people to think about things they might prefer to ignore, such as whether their conduct is ethical. This can trigger discomfort, and some people may simply close their minds to it. It does not follow that we ought to stop talking about these issues.

That is, however, what the leaders of open source decided to do. They figured that by keeping quiet about ethics and freedom, and talking only about the immediate practical benefits of certain free software, they might be able to “sell” the software more effectively to certain users, especially business.

This approach has proved effective, in its own terms. The rhetoric of open source has convinced many businesses and individuals to use, and even develop, free software, which has extended our community—but only at the superficial, practical level. The philosophy of open source, with its purely practical values, impedes understanding of the deeper ideas of free software; it brings many people into our community, but does not teach them to defend it. That is good, as far as it goes, but it is not enough to make freedom secure. Attracting users to free software takes them just part of the way to becoming defenders of their own freedom.

Sooner or later these users will be invited to switch back to proprietary software for some practical advantage. Countless companies seek to offer such temptation, some even offering copies gratis. Why would users decline? Only if they have learned to value the freedom free software gives them, to value freedom in and of itself rather than the technical and practical convenience of specific free software. To spread this idea, we have to talk about freedom. A certain amount of the “keep quiet” approach to business can be useful for the community, but it is dangerous if it becomes so common that the love of freedom comes to seem like an eccentricity.

That dangerous situation is exactly what we have. Most people involved with free software, especially its distributors, say little about freedom—usually because they seek to be “more acceptable to business.” Nearly all GNU/Linux operating system distributions add proprietary packages to the basic free system, and they invite users to consider this an advantage rather than a flaw.

Proprietary add-on software and partially nonfree GNU/Linux distributions find fertile ground because most of our community does not insist on freedom with its software. This is no coincidence. Most GNU/Linux users were introduced to the system through “open source” discussion, which doesn’t say that freedom is a goal. The practices that don’t uphold freedom and the words that don’t talk about freedom go hand in hand, each promoting the other. To overcome this tendency, we need more, not less, talk about freedom.
Conclusion

As the advocates of open source draw new users into our community, we free software activists must shoulder the task of bringing the issue of freedom to their attention. We have to say, “It’s free software and it gives you freedom!”—more and louder than ever. Every time you say “free software” rather than “open source,” you help our campaign.
Footnotes

Joe Barr’s article, “Live and let license,” gives his perspective on this issue.

Lakhani and Wolf’s paper on the motivation of free software developers says that a considerable fraction are motivated by the view that software should be free. This was despite the fact that they surveyed the developers on SourceForge, a site that does not support the view that this is an ethical issue.

back to top
Check out other Free Software Foundation campaigns

* Defective by Design, a campaign against Digital Restrictions Management (DRM)
* Windows 7 Sins, the case against Microsoft and proprietary software
* PlayOgg — support free media formats

—————————————————————————-
this page from http://www.gnu.org/philosophy/open-source-misses-the-point.html

Posted by: computoman | October 17, 2009

Simple line editor.

Simple line editor. This is a work in progress, so there may be some issues.


DECLARE FUNCTION Acquire.Command$ (Maxlen!)
DECLARE FUNCTION Acquire.text$ (Maxlen!, Tsize!, Flag.sound%)
COMMON SHARED In.line$, In.line1$, Zend
CONST Page.width = 75
CONST Wsize = 50
'**
'* Lizzyword
'**
'SCREEN 2, 1
' vga required
REM CLEAR 80000
DEFINT A-Z
DIM T$(1000), FP(1000)
Tsize! = 5
Fs% = 1
WIDTH Page.width + 5, Wsize
CL = 0
HL = 0
CLS
PRINT "Lizzyword (V.: -1) [Cmd: H (for help)] Computoman"
PRINT STRING$(79, "=")
VIEW PRINT 3 TO Wsize

'--
' give directions
'--
'GOSUB Help
'PRINT "Current line number is"; CL; ". To append text ";
'PRINT "at line #1 respond: "
'PRINT "Cmd: A After: 0"

'--
' initialize a linked list
'--
AV = 2
Amount.tab = 0
FP(1) = 0
FOR I = 2 TO 999
FP(I) = I + 1
NEXT I
FP(1000) = 0
true = -1
WHILE true
'--
' input command
'--
'PRINT "-------------------------------------------------"
PRINT "Cmd: ";
L$ = Acquire.Command$(Page.width)
L$ = UCASE$(L$)
L1 = CL
L2 = CL
'--
' interpret commands
'--
L2$ = LEFT$(L$, 2)
SELECT CASE L2$
CASE "C/"
IF LEN(L$) < 3 THEN
PRINT "type in form of c/old/new"
ELSEIF RIGHT$(L$, 1) "/" THEN
PRINT "You need a slash at the end!"
ELSEIF RIGHT$(L$, 2) = "//" THEN
PRINT "Need text between last two slashes!"
ELSE
GOSUB Changeit
END IF
CASE "F/"
IF (LEN(L$) - 3) >= 0 THEN
GOSUB findit
ELSE
PRINT "No text to find."
END IF
CASE "L/"
Pageplus = LEN(L$)
SELECT CASE Pageplus
CASE 3
IF RIGHT$(L$, 1) = "-" OR RIGHT$(L$, 1) = "+" THEN
GOSUB Pageit
END IF
CASE 2
PRINT "No direction found."
END SELECT
CASE ELSE
REM
END SELECT
SELECT CASE L$
CASE "A", "R"
V$ = "After"
CASE "G"
V$ = "Where"
CASE ELSE
V$ = "From"
END SELECT
SELECT CASE L$
CASE "N"
INPUT "How many spaces over: ", Nudge.factor
END SELECT
SELECT CASE L$
CASE "A", "C", "D", "G", "L", "P", "T", "R", "S", "M", "B", "N"
PRINT V$;
INPUT ": ", L1
L2 = L1
END SELECT
SELECT CASE L$
CASE "C", "D", "L", "P", "T", "S", "M", "B", "N"
INPUT "To: ", L2A
IF L2A = 0 THEN
L2 = L1 + (Wsize - 3)
ELSE
L2 = L2A
END IF
END SELECT
SELECT CASE L$
CASE "I"
GOSUB Information
CASE "E"
Fs% = -Fs%
CASE "H", "?"
GOSUB Help
CASE "X"
GOSUB Help.print
CASE "N"
GOSUB Nudge.text
CASE "O"
GOSUB Screendump
CASE "Q"
CLS
PRINT
PRINT "Thank you for using Lizzyword."
PRINT
PRINT " computoman"
PRINT
A$ = ""
WHILE A$ = ""
A$ = INPUT$(1)
WEND
END
CASE "V"
PRINT USING "###:"; CL;
PRINT T$(CP)
CASE "A"
GOSUB Lineappend
CASE "R"
GOSUB Readfile:
CASE "G"
CL = L1
CASE "W"
INPUT "Enter tab size: ", Tsize!
IF Tsize! = 0 THEN
Tsize! = 5
END IF
CASE "L"
GOSUB Listtext
CASE "D"
GOSUB Delete
CASE "C"
GOSUB Change
CASE "P"
GOSUB Printtext
CASE "S"
GOSUB Savetext
CASE "T"
GOSUB LtrimText
CASE "M"
GOSUB MiddleText
CASE "B"
GOSUB BankRightText
CASE "Z"
CLS
END SELECT
WEND
Help:
'
'..........help routine ....................
PRINT "Would you like a long help list (Y/N): ";
TT$ = ""
WHILE TT$ "Y" AND TT$ "N"
TT$ = UCASE$(INPUT$(1))
WEND
PRINT TT$
IF UCASE$(TT$) = "Y" THEN
'..........extended help routine ....................
PRINT "(A)ppend lines of text from keyboard."
PRINT "(B)ank text to the right."
PRINT "(C(/))hange one or more lines or within a line."
PRINT "(D)elete one or more existing lines."
PRINT "(F/)ind first display of text within a line or lines."
PRINT "(G)o to a particular line."
PRINT "(H)elp."
PRINT "(I)nfo to find current line number."
PRINT "(L)ist one or more lines. (L/+ = +20 lines L/- = -20 lines"
PRINT "(M)iddle text on one or more lines."
PRINT "(N)udge over so many spaces on specific lines."
PRINT "(O)utput the screen to printer help."
PRINT "(P)rint one or more lines to the printer."
PRINT "(Q)uit this program without saving."
PRINT "(R)ead lines of text from a disk into the current file."
PRINT "(S)ave one or more lines of text of the current file to disk."
PRINT "(T)rim blanks from left side of line."
PRINT "(V)erify a line. (W)iden tab."
PRINT "(X)tra help for print commands. (Z)ero screen."
PRINT " Respond to other ':' prompts with a line number. Otherwise"
PRINT " pressing 'Enter' defaults to the current line number."
ELSE
PRINT "After 'Cmd: ' type (A)ppend, (B)ank, (C/)hange, (D)elete, (F/)ind,"
PRINT "(G)o to, (H)elp, (I)nfo, (L(/))ist, (M)iddle, (N)udge, (O)utput,"
PRINT "(P)rint, (Q)uit, (R)ead, (S)ave, (T)rim, (V)erify, (W)iden,"
PRINT "(X)tra, or (Z)ero."
PRINT "Respond to other ':' prompts with a line number. Otherwise"
PRINT "responding with 'Enter' defaults to the current line number."
END IF
RETURN
Information:
'--
' (I)nformation command
'--
PRINT "Current line is: "; CL; " highest line is: "; HL; "."
RETURN
Lineappend:
'--
' line (A)ppend command
'--
B$ = ""
DO WHILE B$ "." AND AV 0
PRINT USING "###> "; L1 + 1;
B$ = Acquire.text$(Page.width + 5, Tsize!, Fs%)
IF B$ = "." THEN
EXIT DO
END IF
IF LEN(B$) = 0 THEN
B$ = " "
END IF
CL = L1 + 1
I = 1
K = 1
DO UNTIL FP(I) = 0 OR K = CL
I = FP(I)
K = K + 1
LOOP
J = AV
AV = FP(J)
FP(J) = FP(I)
FP(I) = J
T$(J) = B$
CP = J
HL = HL + 1
IF CL = HL THEN
HP = CP
END IF
L1 = CL
LOOP
IF AV = 0 THEN
PRINT "Buffer is full"
END IF
RETURN
Change:
'--
'(C)hange command
'--
CL = L1
IF L2 > HL THEN
PRINT "Last line number does not exist!"
ELSE
DO
I = 1
K = 1
WHILE NOT (FP(I) = 0 OR K = CL)
I = FP(I)
K = K + 1
WEND
CP = FP(I)
PRINT USING "###:"; CL;
PRINT T$(CP)
PRINT USING "###>"; CL;
T$(CP) = Acquire.text$(Page.width + 5, Tsize!, Fs%)
IF CL L2
END IF
RETURN
Delete:
'--
'(D)elete command
'--
CL = L1
IF L2 > HL THEN
L2 = HL
END IF
FOR C = 0 TO L2 - L1
I = 1
K = 1
DO
IF FP(I) = 0 OR K = CL THEN
IF FP(I) = 0 THEN
PRINT "There is no text to delete!"
EXIT FOR
ELSE
J = FP(I)
FP(I) = FP(J)
FP(J) = AV
AV = J
HL = HL - 1
CP = I
IF HL = CL THEN
HP = CP
END IF
EXIT DO
END IF
END IF
I = FP(I)
K = K + 1
LOOP
NEXT C
CL = CL - 1
IF CL HL THEN
L2 = HL
END IF
IF I = 0 THEN
PRINT "Buffer empty"
ELSE
DO
IF NOT (K L2
CL = K - 1
END IF
RETURN
Printtext:
'--
'(P)rint text
'--
I = FP(1)
K = 1
IF L2 > HL THEN
L2 = HL
END IF
IF I = 0 THEN
PRINT "Buffer empty"
ELSE
PRINT "Enter name of file to print ('prn' for printer): ";
Out.to.file$ = Acquire.Command$(Page.width + 5)
IF Out.to.file$ = "" THEN
Out.to.file$ = "con"
END IF
PRINT "Please ready device to handle input. When ready press .";
A$ = ""
WHILE A$ = ""
A$ = INPUT$(1)
WEND
OPEN Out.to.file$ FOR OUTPUT AS #2
DO
IF NOT (K L2
CL = K - 1
END IF
CLOSE #2
RETURN
Savetext:
'--
'(S)ave text
'--
I = FP(1)
K = 1
IF L2 > HL THEN
L2 = HL
END IF
IF I > 0 THEN
PRINT "Enter a Lizzyword filename to save: ";
z$ = Acquire.Command$(Page.width + 5)
OPEN z$ FOR OUTPUT AS #1
DO
IF NOT (K L2 + 1
CL = K - 1
CLOSE #1
ELSE
PRINT "Buffer empty"
END IF
RETURN
Readfile:
'--
'(R)ead file
'--
PRINT "Enter Lizzyword file to read: ";
Q$ = Acquire.Command$(Page.width + 5)
Zend = 0
OPEN Q$ FOR INPUT AS #1
DO WHILE NOT (EOF(1) OR AV = 0)
LINE INPUT #1, B$
PRINT USING "###>"; L1 + 1;
PRINT B$
IF LEN(B$) = 0 THEN
B$ = " "
END IF
CL = L1 + 1
I = 1
K = 1
DO UNTIL FP(I) = 0 OR K = CL
I = FP(I)
K = K + 1
LOOP
J = AV
AV = FP(J)
FP(J) = FP(I)
FP(I) = J
T$(J) = B$
CP = J
HL = HL + 1
IF CL = HL THEN
HP = CP
END IF
L1 = CL
LOOP
IF AV = 0 THEN
PRINT "buffer is full"
END IF
CLOSE #1
RETURN

findit:
'--
' (F)ind command f/text/
'--
LP = LEN(L$) - 3
P$ = MID$(L$, 3, LP)
IF LP = 0 THEN
P$ = " "
END IF
I = 1
K = 1
DO
I = FP(I)
IF I = 0 THEN
PRINT "Text not found"
EXIT DO
ELSE
FOR Q = 1 TO LEN(T$(I))
IF MID$(T$(I), Q, LP) = P$ THEN
CP = I
CL = K
PRINT USING "###:"; CL;
PRINT T$(CP)
EXIT DO
END IF
NEXT Q
K = K + 1
END IF
LOOP
RETURN

Changeit:
'--
' c/ change text c/old/new/
'--
r$ = ""
P = 3
DO
X$ = MID$(L$, P, 1)
IF X$ = "/" THEN
EXIT DO
END IF
r$ = r$ + X$
P = P + 1
LOOP
N$ = ""
FOR Q = P + 1 TO LEN(L$) - 1
N$ = N$ + MID$(L$, Q, 1)
NEXT Q
lT = LEN(T$(CP)): lR = P - 3
FOR Q = 1 TO lT
IF MID$(T$(CP), Q, lR) = r$ THEN
EXIT FOR
END IF
NEXT Q
IF Q > lT THEN
PRINT r$; " not found"
ELSE
T$(CP) = LEFT$(T$(CP), Q - 1) + N$ + RIGHT$(T$(CP), lT - Q - lR + 1)
PRINT USING "###:"; CL;
PRINT T$(CP)
END IF
RETURN
Screendump:
'--
' transfer screen to printer
'--
PRINT "Press (shift) (print-screen) at any time to get a screen dump."
RETURN
LtrimText:
'--
'l(T)rim text
'--
I = FP(1)
K = 1
IF L2 > HL THEN
L2 = HL
END IF
IF I = 0 THEN
PRINT "Buffer empty"
ELSE
DO
IF NOT (K L2
CL = K - 1
END IF
RETURN

MiddleText:
'--
'(M)iddle text
'--
I = FP(1)
K = 1
IF L2 > HL THEN
L2 = HL
END IF
IF I = 0 THEN
PRINT "Buffer empty"
ELSE
DO
IF NOT (K L2
CL = K - 1
END IF
RETURN

Pageit:
Marker$ = MID$(L$, 3, 1)
SELECT CASE Marker$
CASE "+"
IF CL > HL THEN
CL = CL - (Wsize - 3)
END IF
CASE "-"
CL = CL - ((Wsize - 3) * 2)
IF CL HL THEN
L2 = HL
END IF
IF I = 0 THEN
PRINT "Buffer empty"
ELSE
DO
IF NOT (K L2
CL = K - 1
END IF
RETURN

Nudge.text:
'--
'(N)udge text
'--
I = FP(1)
K = 1
IF L2 > HL THEN
L2 = HL
END IF
IF I = 0 THEN
PRINT "Buffer empty"
ELSE
DO
IF NOT (K L2
CL = K - 1
END IF
RETURN

Help.print:
PRINT
PRINT "Printer help commands."
PRINT
PRINT "P = page foreward (øP )"
PRINT "I = italics (øI1 for on and øI0 for off)"
PRINT "L = large print (øL1 øL0 )"
PRINT "S = condensed print (øS1 øS0 )"
PRINT "T = tab size if needed. (øTsize to set size )"
PRINT "Q = near letter quality (øQ1 øQ0 )"
PRINT "U = underlining (øU1 øU0 )"
PRINT "F = insert file into print job (øFfilename )"
RETURN

DEFSNG A-Z
'=================================================
FUNCTION Acquire.Command$ (Maxlen!)
Crow = CSRLIN
Ccol = POS(0)
LOCATE Crow, Ccol
GOSUB Gline11
'PRINT
Acquire.Command$ = Com.line$
PRINT
EXIT FUNCTION

' ------------------------------------------------
' gchar - get a character
Gchar11:
Clizzy$ = INPUT$(1)
C = ASC(Clizzy$)
IF C 8 THEN
IF C &HD THEN
PRINT CHR$(C);
END IF
ELSE
IF LEN(Com.line$) > 0 THEN
PRINT " ";
END IF
END IF
RETURN
' ----------------------------------------------------
' gline - get a line
Gline11:
Com.line$ = ""
DO
GOSUB Gchar11
SELECT CASE C
CASE &HD
PRINT " ";
CASE 29, 8
IF LEN(Com.line$) > 0 THEN
Com.line$ = LEFT$(Com.line$, LEN(Com.line$) - 1)
END IF
CASE ELSE
Com.line$ = Com.line$ + CHR$(C)
END SELECT
LOOP UNTIL LEN(Com.line$) >= Maxlen OR (C = &HD AND LEN(Com.line$) >= Zero)
RETURN
END FUNCTION

'=================================================
FUNCTION Acquire.text$ (Maxlen!, Tab.size!, Flag.sound%)
PRINT In.line$;
GOSUB Gline1
Newb$ = ""
IF LEN(In.line$) >= Page.width THEN
WHILE RIGHT$(In.line$, 1) " " OR LEN(In.line$) >= Page.width
Newb$ = RIGHT$(In.line$, 1) + Newb$
IF LEN(In.line$) > 0 THEN
In.line$ = LEFT$(In.line$, LEN(In.line$) - 1)
END IF
PRINT " ";
WEND
END IF
Acquire.text$ = In.line$
In.line$ = Newb$
PRINT
EXIT FUNCTION

' ------------------------------------------------
' gchar - get a character
Gchar1:
Clizzy$ = INPUT$(1)
IF Flag.sound% = 1 THEN
REM SOUND 55, .5
END IF
C = ASC(Clizzy$)
IF C 8 THEN
SELECT CASE C
CASE &HD
REM
CASE 14
Flag.sound% = -Flag.sound%
CASE 9
Lim = (Tab.size - 1) - (LEN(In.line$) MOD Tab.size)
IF Lim 0 THEN
PRINT " ";
END IF
END IF
RETURN
' ----------------------------------------------------
' gline - get a line
Gline1:
DO
GOSUB Gchar1
SELECT CASE C
CASE &HD
PRINT " ";
CASE 9
In.line$ = In.line$ + SPACE$(Lim)
CASE 29, 8
IF LEN(In.line$) > 0 THEN
In.line$ = LEFT$(In.line$, LEN(In.line$) - 1)
END IF
CASE 14
REM
CASE ELSE
In.line$ = In.line$ + CHR$(C)
END SELECT
z = POS(0)
y = CSRLIN
VIEW PRINT
LOCATE 1, 75
PRINT USING "C:###"; LEN(In.line$) + 1;
VIEW PRINT 3 TO Wsize
LOCATE y, z
LOOP UNTIL LEN(In.line$) >= Maxlen OR (C = &HD AND LEN(In.line$) >= Zero)
RETURN

END FUNCTION

Posted by: computoman | October 17, 2009

Gnu Freedoms.

Gnu Freedoms as interpreted of Dann Washko of TLLTS.

GNU Four Freedoms Translation Attempt One
Filed under: Linux/FOSS — dann @ 8:00 pm

I was reading an article about Freesoftware adoption and it noted that the freedoms afforded by the GNU Gpl were written largely for developers not end users. End users being regular Janes and Joes milling about big box stores looking for bits and bytes to do something useful for them. So I figured I would take a shot at positing the four freedoms to general users. It’s a very rough attempt but hopefully something to think about.

First Benefit: The freedom to run the software as you would like to run it on as many computers as you would like to run it on. Want the run the software on your laptop and your workstation at the same time? Go ahead! Want to copy the software to each computer in a computer lab and then let any student run it when he or she wants to? You may!

Second Benefit: You can learn how the program operates and share this information with anyone. This is great if you want to learn how to write your own software. But even more, if you are the kind of person that likes to learn as much as they can about something, benefit 2 will aid you. Even more, because this benefit is available to everyone, you get to learn from their experiences too! You can take what you learn and publish it to the web, make a movie or even write a book! Sure you can do this with non-free software but there are no limits, no restrictions when it comes to freesoftware.

Third Benefit: You can share the software with your friends and family. School can give a copy of the software they use in the computer labs to each student so he or she can use the software at home. That way mom and dad can also use the same programs their children are using. They could even take the programs to work and let people in the office use them should their IT department allow this? Want to continue working on a project for work at home? If you are using free software at work there are no barriers to you using the same software at home!

Fourth Benefit: Freedom to change and improve the software. Maybe you are not a programmer, most people are not. Therefore you might think this benefit is not going to help you, but you could be wrong. Think about it. You find a piece of software that is almost a 100% fit for your company or a project you are working on. Almost! If only it had this one feature. Well, you can ask or even pay someone to add that feature for you. You nor they are restricted in making these changes! Another bonus of this is as you or others make changes those changes can be released to the rest of the world so everyone benefits. The more people doing this the better the software gets; the more features it can have! No barriers baby!

Posted by: computoman | October 16, 2009

Quick rant about about certain software.

This in response to a podcast touting mswindows home server and mswindows 7

In ten years of doing an mswindows admin and client support for thousands of machines less than ten times was defragging ever needed, Unless you are adding and deleting files incessantly, there is no need for it. Defragging only puts unneeded wear and tear on the drive. In fact we could always tell an amateur tech support person, because they would recommend defragging as the all cure.

Secondly it is very easy to use winrsync (as well as other programs) with freenas (as well as Llnux/unux backup boxes) to backup mswindows clients either totally or piecemeal. Normally I leave my backup server turned off unless I know I am going to do some data backup. So the power issue is not that critical. With linux and mswindows you can start and shut down a server either manually or with batch files very easily. You can have the server (with hardware that supports it) turn on at night when backups can be done at a low peak usage period. Large files are burned to dvd to conserve server space. I have no problem using 200 to 500 megabyte storage for a server since media and other large data files and etc are offloaded to dvd. If I want to look at a dvd it is just easy as picking up a dvd and throwing into a machine.

Lastly, I did spend quite a bit of time with Windows home server with the disk media I was sent directly from Microsoft. The un-upgraded version ran pretty well, for a mswindows os, but once I upgraded nothing worked, anymore including our tv card. It was a piece of crap. There has been documented multiple issues with it security wise for windows home server. Our linux server box could do twice as much with half the horsepower that mswindows home server requires and not be limited to ten users. You could do the same thing with os/x 4.8 on a ppc box and still be better than whs.

I saw a full demo of Google wave. It seemed interesting. I have not seen the software (basecamnp) that Veronica recommended, so I can not compare. In the demo of Google wave I saw, it was mentioned that they might have a local version for free that you could install on a local area network but they were still working out security issues. I wonder if that is also true on the Google hosted version since there is so much delay in bringing out the product.

As for Windows 7, it does not seem to like via chipsets with integrated video and etc, That may have changed by now. I have installed W7rc on several name brand dual core machines that were vista ready without a hitch except for the the long time it took to install the os and all the basic software. Personally have used osx, linux, bsd, and microsoft windows XP, I saw no real advantage of using mswindows 7 over the others except for emptying the bank account for having to upgrade to get new hardware to run w7. Even Microsoft now admits you really need a 64 bit machine with honking memory to run it right. MS allegedly just came out with a bunch of security and other updates for w7. If you have W7, be sure and get them. I do agree with Daymoo about updating hardware drivers directly from the vendor. Microsoft update is just a quick fix. Getting the drivers from the vendor is true for all operating systems. Unless you get a qualified tech to do it for you. there is no easy way around it. When Microsoft is already touting mswindows 8, it makes me wonder how much faith they really have in their own product.

W8
An alleged comment by a CEO on his product
Alleged security issues

Basecamp alternatives

Linux public service annoucement:

Your computer has problems? Want to hear the industry solution? That’s right! Your software is not working. So what do they suggest? Use more software to solve the problem. Listen to what you are being told. They want you to purchase software so the software you already purchased will work. What? The problem is we come come to think this as being perfectly acceptible. So stop accepting. There has been a solution all along, but you have rarely hear of it. That’s right! You have spent hundreds maybe thousands of dollars over the years that you did not have to. It is time for the secret to be told. Thousands of businesses, universities, and even Wall Street has been using Linux, for years. What do they know that you do not. Linux is Free. It does not need any virus protection and ninety-nine point nine percent of all the software you will ever need comes free as well. It is just as easy as clicking a mouse. That’s it. No more crashes. No more viruses. No more blue screens of death. And get this. With linux, you do not have to reboot after installing new software. Linux runs on old hardware. No need to buy a new computer everytime the industry decides to boost profits and release another buggy system. So, why are you still paying for the priveledge of using your computer? There is a better way, Linux!

Posted by: computoman | October 15, 2009

Four sound card music machine. (in progress)

I know that it is getting close to Halloween. Hopefully this will not be that hard of a project to complete. You probably could do this with a really old machine, but then you would be messing with jumpers and having to do some real fancy setup.

What do we need to start with.
A reasonably new pc (minimum 256meg ram empty 10 gig hard drive). with four spare pci slots.
Four sets of speakers with built in amps and input extension cables. I had some spares.
Linux that supports pulse audio. Ubuntu 9.04 should work.
Up to four microphones.

1. install ubuntu
2 install audacity in and from ubuntu.
3. get on the internet and look for some scary sound and music. if you have several microphones, you can create your own.

Posted by: computoman | October 9, 2009

Predict your future.

Predict your future (not really), but it makes for a fun time at a party. Another freebasic goodie.


DECLARE SUB Cartomancy ()
DECLARE SUB Oracle ()
'*******************************************************
'* Program title :
'* Version number :
'* Date started :
'* Last update :
'* Authored by :
'* Written for :
'* Language :
'* Program intent :
'* I/O and files :
'* Data dictionary:
'*------------------------------------------------------

DEFINT A-Z

CONST the.title = "The Oracle."
DO
VIEW PRINT
CLS
PRINT
PRINT
PRINT TAB(5); the.title
PRINT
PRINT " A - Oracle"
PRINT " B - Cartomancy"
PRINT " Q - Quit"
PRINT
PRINT " choice: ";
Z$ = " "
DO WHILE INSTR("ABQ", Z$) < 1
Z$ = ""
DO WHILE Z$ = ""
Z$ = UCASE$(INPUT$(1))
LOOP
LOOP
PRINT Z$
SELECT CASE Z$
CASE "A"
CALL Oracle
GOSUB Pause0
CASE "B"
CALL Cartomancy
GOSUB Pause0
CASE "Q"
EXIT DO
CASE ELSE
REM
END SELECT
LOOP
PRINT
PRINT
END

Pause0:
PRINT
PRINT "Press any key to continue: ";
a$ = INPUT$(1)
PRINT a$
a$ = ""
RETURN

'==================================================================
Oracledat:
DATA "Yes, if you are creative."
DATA "Yes, if you are receptive."
DATA "Anything is possible, but you will have a difficult start."
DATA "What a youthful folly to ask!"
DATA "You must wait and ask again."
DATA "Only conflict will come of the result, please pray."
DATA "It will take many who are organized to accomplish your request."
DATA "Yes, if you keep it together."
DATA "Be meek and you will get your answer."
DATA "You are lucky to get this far!"
DATA "You must have the fellowship of men."
DATA "In great measure will the possession result."
DATA "One must be modest to attain their goal."
DATA "You will do good to have enthusiasm for your quest."
DATA "Let someone else take the lead to your quest."
DATA "Atone for what has been spoiled, then reask your question."
DATA "You are too far away to get the answer."
DATA "Meditation will lead you to your answer."
DATA "Bite through to your goal."
DATA "If you handle life with grace!"
DATA "There is to be a coming apart for fate to be realized."
DATA "All must return to what is."
DATA "Not knowing the true answer will be better."
DATA "You must tame the power of the great."
DATA "Watch the corners of the mouth."
DATA "The greatest preponderance will be fate."
DATA "It will be the abysmals, sorry!"
DATA "You will be lucky to hold on to what you have."
DATA "Influence will be the steeping stone to your quest."
DATA "Just be patient for a while."
DATA "It is a time for getting away."
DATA "The power of the great is upon you."
DATA "Yes, there is a progression to be attained."
DATA "The crytal ball is losing light and no answer may be attained now."
DATA "Everyone close will be part of your answer."
DATA "No, there is too much opposition."
DATA "Not likely, there are obstructions in the way."
DATA "Yes, deliverance will come."
DATA "Not as much as you might as supposed."
DATA "Yes and more than was planned."
DATA "Yes, if there is a breakthrough."
DATA "Maybe if you come to meet."
DATA "Now is the time to gather together for the answer."
DATA "Yes, only if there is a push upward."
DATA "No, oppression will stop your quest."
DATA "Yes, no, and maybe......."
DATA "What the oracle says is opposite to your true answer."
DATA "The answer will take longer and you will pay for the wait."
DATA "Only through an arousing!"
DATA "It is not time for a move, you must keep still."
DATA "Let fate develop as it will."
DATA "You must see the marrying maiden first."
DATA "More than you ever imagined."
DATA "You may wonder and wander, but it is time to move."
DATA "Only if you act gently."
DATA "Yes, with great joy!"
DATA "No, so you must let go of it to spread out."
DATA "Only with limitations."
DATA "Look within yourself and you can find the answer."
DATA "Only with preponderance of the small."
DATA "It will come to be after completion."
DATA "Only before completion."
DATA "I love Elizabeth!"
DATA "Only God knows..."

Carto:
DATA R,G,H,M,"The home, love, friendship, and happiness."
DATA R,G,H,L,"A good natured impetuous, fair-haired man."
DATA R,G,H,K,"A trustworthy, fair haired woman."
DATA R,G,H,J,"A close friend."
DATA R,G,H,I,"Good fortune and happiness."
DATA P,G,H,H,"Dreams come true from wealth, good luck, and status."
DATA P,G,H,G,"Invitations and festivities."
DATA P,B,H,F,"False hopes and broken promises an unreliable person."
DATA P,G,H,E,"An overgenerous disposition, unexpected good fortune."
DATA P,B,H,D,"Jealousy and indecisiveness."
DATA P,B,H,C,"Changes, delays, and postponements."
DATA P,B,H,B,"Warning for a need of caution."
DATA P,G,H,A,"Success and prosperity."
' data for clubs
DATA R,G,C,M,"Wealth, health, love, and happiness."
DATA R,G,C,L,"An honest, generous dark haired man."
DATA R,G,C,K,"An attractive, self-confident, and dark-haired woman."
DATA R,G,C,J,"A reliable friend."
DATA R,G,C,I,"Unexpected money and good luck."
DATA P,B,C,H,"Friends being stubborn."
DATA P,B,C,G,"Opposition, dissappointment, and the taking of reckless chances."
DATA P,G,C,F,"Prosperity - if someone of the opposite sex does not interfere."
DATA P,G,C,E,"Business Success."
DATA P,G,C,D,"A new friend or sucessful marriage."
DATA P,B,C,C,"Fortunes changing for the worse."
DATA P,G,C,B,"Marriage bringing money or several partnerships."
DATA P,B,C,A,"Oppositions and disappointments."
' data for diamonds
DATA R,G,D,M,"Money, a letter or a ring."
DATA R,B,D,L,"A stubborn, quick-tempered, fair-haired man."
DATA R,B,D,K,"A flirtatious, sophisticated, fair-haired woman."
DATA R,B,D,J,"A relative, not altogether reliable."
DATA R,G,D,I,"Marriage, money, journey, or changes."
DATA P,B,D,H,"Restlesness. A surprise connected with money."
DATA P,G,D,G,"A marriage late in life. New relationship from travel."
DATA P,B,D,F,"Heavy losses."
DATA P,B,D,E,"A warning against a second marriage."
DATA P,G,D,D,"Prosperity, good news, or a happy family."
DATA P,B,D,C,"An inheritance, changes, and trouble."
DATA P,B,D,B,"Legal or domestic disputes."
DATA P,G,D,A,"A serious love affair."
' data for spades
DATA R,B,S,M,"Emotional conflict, unfortunate love affair or the end."
DATA R,B,S,L,"An ambitious dark-haired man."
DATA R,G,S,K,"An unscrupuluos dark-haired woman."
DATA R,B,S,J,"A well meaning, but lazy aquaintance."
DATA R,B,S,I,"Misfortune and worry."
DATA P,B,S,H,"Bad luck in all things."
DATA P,B,S,G,"Trouble and disappointment ahead."
DATA P,B,S,F,"Sorrow and loss of friendship."
DATA P,G,S,E,"Some improvement in circumstances."
DATA P,G,S,D,"Reverses and anxieties, but eventual success."
DATA P,B,S,C,"Jealousy, illness, and business worries."
DATA P,B,S,B,"Faithlessness and partings."
DATA P,B,S,A,"Separation, scandal, and deceit."
DATA Two
DATA Three
DATA Four
DATA Five
DATA Six
DATA Seven
DATA Eight
DATA Nine
DATA Ten
DATA Jack
DATA Queen
DATA King
DATA Ace
DATA end
DATA "Personality and state of mind."
DATA "Family and home."
DATA "Present desires."
DATA "Hopes and expectations."
DATA "The unexpected."
DATA "The immediate future."
DATA "The more distant future."

DEFSNG A-Z
SUB Cartomancy
' ==========================================================================
' program: carto.bas
' programmer: computoman
' last update: 01/21/1994
' note: simple program based on cartomancy
'
' ==========================================================================
' start
RESTORE Carto
Termlines = 25
WIDTH 80, Termlines
GOSUB housevkeeping
WHILE dovfortune
GOSUB dovcards
WEND
GOSUB endvofvjob1
EXIT SUB
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' housekeeping
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
housevkeeping:
CLS
dovfortune = 1
RANDOMIZE TIMER
lastvpage = 7
lastvchoose = 3
deckvsize = 52
DIM checkvit(deckvsize), displayvindex(lastvpage * lastvchoose)
firstvcard = 1
DIM cardvtype$(deckvsize), cardvgrade$(deckvsize), Cardvinfo$(deckvsize)
DIM cardvfavor$(deckvsize), cardvclass$(deckvsize)
FOR cardvnumber = firstvcard TO deckvsize
READ cardvclass$(cardvnumber)
READ cardvfavor$(cardvnumber)
READ cardvtype$(cardvnumber)
READ cardvgrade$(cardvnumber)
READ Cardvinfo$(cardvnumber)
NEXT cardvnumber
' ---------------------------------------------------------------------------
' data for hearts
DIM cardvkind$(26), cardvvalue$(14)
cardvkind$(ASC("H") - 64) = "Hearts"
cardvkind$(ASC("C") - 64) = "Clubs"
cardvkind$(ASC("D") - 64) = "Diamonds"
cardvkind$(ASC("S") - 64) = "Spades"
FOR numbervofvsuit = 1 TO 14
READ cardvvalue$(numbervofvsuit)
NEXT numbervofvsuit
DIM title$(lastvpage)
FOR pagevnumber = 1 TO lastvpage
READ title$(pagevnumber)
NEXT pagevnumber
OPEN "lastshow.txt" FOR OUTPUT AS #1
RETURN
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' cartomancy
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
dovcards:
DO UNTIL UCASE$(done$) = "N"
CLS
LOCATE Termlines, 1
PRINT "Computoman 2009"
LOCATE 1, 1
PRINT
PRINT " Predict your future with playing cards!"
PRINT
PRINT " There are seven areas of your life that will be considered."
PRINT "Each area will be considered one at a time. Advanced versions"
PRINT "of this program will allow you to record results on disk for"
PRINT "later use. For now, plese have a pencil and paper ready!"
PRINT "Use - to get hardcopy!"
PRINT
PRINT "1. Personaily and state of mind."
PRINT "2. Family and Home."
PRINT "3. Present desires."
PRINT "4. Hopes and expectations."
PRINT "5. The unexpected."
PRINT "6. The immediate future."
PRINT "7. The more distant future."
PRINT
INPUT "Press return to continue: ", govon$
combo$ = ""
done$ = ""
FOR a = 1 TO deckvsize
checkvit(a) = 0
NEXT a
GOSUB details
PRINT
CLS
LOCATE Termlines, 1
PRINT "Computoman 2009"
LOCATE 1, 1
PRINT
PRINT "You have seen all of this reading!"
PRINT
PRINT "Want a new reading (Y/N):", done$
WHILE UCASE$(done$) "Y" AND UCASE$(done$) "N"
done$ = INPUT$(1)
WEND
dovfortune = 0
LOOP
RETURN
' ---------------------------------------------------------------------------
' print details
details:
FOR pagevnumber = 1 TO lastvpage
GOSUB pagevheader
FOR choose = 1 TO lastvchoose
cardvindex = (((pagevnumber - 1) * lastvchoose) + choose)
GOSUB choosevcard
GOSUB calcs
GOSUB displayvcard
NEXT choose
GOSUB footer
INPUT "Press the return key to continue: ", govon$
NEXT pagevnumber
RETURN
' ---------------------------------------------------------------------------
' choose a card
choosevcard:
rem PLAY "l16" + CHR$(INT(RND(1)* 7) + 65)
choicevit = INT(RND(1) * deckvsize)
IF checkvit(choicevit) = 1 OR choicevit = 0 THEN
GOSUB choosevcard
END IF
RETURN
' ----------------------------------------------------------------------------
' check for special situations
checkvdetails:
PRINT "Checking ......"
C$ = ""
B$ = ""
a$ = ""
' rule 1
a$ = CHR$(1)
B$ = "H"
C$ = "Friendship."
GOSUB logicalvtwo
' rule 2
a$ = CHR$(1)
B$ = "H"
C$ = "Love Affair."
GOSUB logicalvthree
' rule 3
a$ = CHR$(1)
B$ = "D"
C$ = "Money."
GOSUB logicalvthree
' rule 4
a$ = CHR$(1)
B$ = "S"
C$ = "Quarrels."
GOSUB logicalvthree
' rule 5
a$ = CHR$(27)
B$ = CHR$(20)
C$ = "A business proposal."
GOSUB logicalvone
' rule 6
a$ = CHR$(40)
B$ = CHR$(23)
C$ = "A politician."
GOSUB logicalvone
' rule 7
a$ = CHR$(40)
B$ = CHR$(44)
C$ = "A serious undertaking"
GOSUB logicalvone
' rule 8
a$ = CHR$(40)
B$ = CHR$(11)
C$ = "A new baby."
GOSUB logicalvone
' rule 9
a$ = CHR$(5)
B$ = ""
C$ = "Things are better than they seem!"
GOSUB logicalvfour
' rule 10
a$ = CHR$(31)
B$ = CHR$(14 - 1)
C$ = "Marriage bringing money."
GOSUB logicalvone
' rule 11
a$ = CHR$(44)
B$ = ""
C$ = "Things are worse than they seem."
GOSUB logicalvfour
' rule 12
a$ = CHR$(44)
B$ = "C"
C$ = "Business troubles."
GOSUB logicalvtwo
' rule odH
a$ = CHR$(40)
B$ = "C"
C$ = "Theft, forgery, and grave business losses."
GOSUB logicalvthree
' rule 14
a$ = CHR$(6)
B$ = "B"
C$ = "Quarrels and temporary obstacles."
GOSUB logicalvfive
' rule 15
a$ = CHR$(6)
B$ = CHR$(49)
C$ = "Loss of status."
GOSUB logicalvone
' rule 16
a$ = CHR$(19)
B$ = CHR$(7)
C$ = "Gaiety."
GOSUB logicalvone
' rule 17
a$ = CHR$(32)
B$ = "R"
C$ = "Lack of success because of inability to concentrate."
GOSUB logicalvsix
' rule 18
a$ = CHR$(32)
B$ = CHR$(46)
C$ = "A bitter quarrel."
GOSUB logicalvone
' rule 19
a$ = CHR$(45)
B$ = CHR$(34)
C$ = "Loss of money."
GOSUB logicalvone
' rule 20
a$ = CHR$(7)
B$ = CHR$(10)
C$ = "A present of jewelry."
GOSUB logicalvone
' rule 20a
a$ = CHR$(7)
B$ = CHR$(33)
C$ = "A trousseau."
GOSUB logicalvone
' rule 21
a$ = CHR$(33)
B$ = CHR$(10)
C$ = "A present of money."
GOSUB logicalvone
' rule 22
a$ = CHR$(46)
IF MID$(combo$, 21, 1) = a$ THEN
PRINT "Abandon immediate plans!"
END IF
' rule 23
a$ = CHR$(11)
B$ = "R"
C$ = "Many love affairs."
GOSUB logicalvsix
' rule 24
a$ = CHR$(24)
B$ = "R"
C$ = "A loss or injustice to you"
GOSUB logicalvsix
' rule 25
a$ = CHR$(26)
B$ = CHR$(39)
C$ = "An unexpected message."
GOSUB logicalvone
RETURN
' -------------------------------------------------------------------------
' logic sub - specific cards
logicalvone:
IF MID$(combo$, (cardvindex - 1), 1) = a$ THEN
IF MID$(combo$, (cardvindex), 1) = B$ THEN
PRINT C$
END IF
END IF
IF MID$(combo$, (cardvindex - 1), 1) = a$ THEN
IF MID$(combo$, (cardvindex - 2), 1) = B$ THEN
PRINT C$
END IF
END IF
IF MID$(combo$, (cardvindex), 1) = a$ THEN
IF MID$(combo$, (cardvindex - 1), 1) = B$ THEN
PRINT C$
END IF
END IF
IF MID$(combo$, (cardvindex - 2), 1) = a$ THEN
IF MID$(combo$, (cardvindex - 1), 1) = B$ THEN
PRINT C$
END IF
END IF
RETURN
' -------------------------------------------------------------------------
' logic sub - card types
logicalvtwo:
IF MID$(combo$, (cardvindex - 1), 1) = a$ THEN
IF cardvtype$(ASC(MID$(combo$, (cardvindex), 1))) = B$ THEN
PRINT C$
END IF
END IF
IF MID$(combo$, (cardvindex - 1), 1) = a$ THEN
IF cardvtype$(ASC(MID$(combo$, (cardvindex - 2), 1))) = B$ THEN
PRINT C$
END IF
END IF
IF MID$(combo$, (cardvindex), 1) = CHR$(1) THEN
IF cardvtype$(ASC(MID$(combo$, (cardvindex - 1), 1))) = B$ THEN
PRINT C$
END IF
END IF
IF MID$(combo$, (cardvindex - 2), 1) = a$ THEN
IF cardvtype$(ASC(MID$(combo$, (cardvindex - 1), 1))) = B$ THEN
PRINT C$
END IF
END IF
RETURN
' -------------------------------------------------------------------------
' logic sub - card types both sides
logicalvthree:
IF MID$(combo$, (cardvindex - 1), 1) = a$ THEN
IF cardvtype$(ASC(MID$(combo$, (cardvindex - 2), 1))) = B$ THEN
IF cardvtype$(ASC(MID$(combo$, (cardvindex), 1))) = B$ THEN
PRINT C$
END IF
END IF
END IF
RETURN
' -------------------------------------------------------------------------
' logic sub - any specific card
logicalvfour:
FOR hcds = 0 TO 2
IF MID$(combo$, (cardvindex - hcds), 1) = a$ THEN
PRINT C$
END IF
NEXT hcds
RETURN
' -------------------------------------------------------------------------
' logic sub - Card favor
logicalvfive:
IF MID$(combo$, (cardvindex - 1), 1) = a$ THEN
IF cardvfavor$(ASC(MID$(combo$, (cardvindex), 1))) = B$ THEN
PRINT C$
END IF
END IF
IF MID$(combo$, (cardvindex - 1), 1) = a$ THEN
IF cardvfavor$(ASC(MID$(combo$, (cardvindex - 2), 1))) = B$ THEN
PRINT C$
END IF
END IF
IF MID$(combo$, (cardvindex), 1) = CHR$(1) THEN
IF cardvfavor$(ASC(MID$(combo$, (cardvindex - 1), 1))) = B$ THEN
PRINT C$
END IF
END IF
IF MID$(combo$, (cardvindex - 2), 1) = a$ THEN
IF cardvfavor$(ASC(MID$(combo$, (cardvindex - 1), 1))) = B$ THEN
PRINT C$
END IF
END IF
RETURN
' -------------------------------------------------------------------------
' logic sub - card regencies
logicalvsix:
IF MID$(combo$, (cardvindex - 1), 1) = a$ THEN
IF cardvclass$(ASC(MID$(combo$, (cardvindex), 1))) = B$ THEN
PRINT C$
END IF
END IF
IF MID$(combo$, (cardvindex - 1), 1) = a$ THEN
IF cardvclass$(ASC(MID$(combo$, (cardvindex - 2), 1))) = B$ THEN
PRINT C$
END IF
END IF
IF MID$(combo$, (cardvindex), 1) = CHR$(1) THEN
IF cardvclass$(ASC(MID$(combo$, (cardvindex - 1), 1))) = B$ THEN
PRINT C$
END IF
END IF
IF MID$(combo$, (cardvindex - 2), 1) = a$ THEN
IF cardvclass$(ASC(MID$(combo$, (cardvindex - 1), 1))) = B$ THEN
PRINT C$
END IF
END IF
RETURN
' -----------------------------------------------------------------------------
' Display card
displayvcard:
PRINT "Card number "; cardvindex; " is the: ";
PRINT Cardnum$; " of "; Cardsuit$; " and that is "; Favorvresult$
PRINT
PRINT "Meaning: "; Cardvinfo$(choicevit)
PRINT
PRINT #1, "Card number "; cardvindex; " is the: ";
PRINT #1, Cardnum$; " of "; Cardsuit$; " and that is "; Favorvresult$
PRINT #1, ""
PRINT #1, "Meaning: "; Cardvinfo$(choicevit)
PRINT #1, ""
RETURN
' ---------------------------------------------------------------------------
' page headers
pagevheader:
CLS
LOCATE Termlines, 1
PRINT "Computoman 2009"
VIEW PRINT 1 TO 24
PRINT
PRINT TAB((80 - LEN(title$(pagevnumber))) / 2); title$(pagevnumber)
PRINT
PRINT #1, ""
PRINT #1, TAB((80 - LEN(title$(pagevnumber))) / 2); title$(pagevnumber)
PRINT #1, ""
RETURN
' --------------------------------------------------------------------------
' footers
footer:
PRINT "Other details to consider: ";
GOSUB checkvdetails
PRINT
RETURN
' --------------------------------------------------------------------------
' do the calculations
calcs:
SELECT CASE cardvfavor$(choicevit)
CASE "G"
Favorvresult$ = "Good."
CASE "B"
Favorvresult$ = "Challenging."
CASE ELSE
PRINT "Bad data"
END SELECT
combo$ = combo$ + CHR$(choicevit)
checkvit(choicevit) = 1
displayvindex(cardvindex) = choicevit
Cardnum$ = cardvvalue$(ASC(cardvgrade$(choicevit)) - 64)
Cardsuit$ = cardvkind$(ASC(cardvtype$(choicevit)) - 64)
RETURN
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' end of job
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
endvofvjob1:
CLOSE #1
RETURN
END SUB

SUB Oracle
REM **************************************************************************
REM * program: oracle pc
REM * note : random choosing of answer for a question.
REM * programmer: eddie "clark" kent
REM * last update: 01/16/1995
REM *------------------------------------------------------------------------
RESTORE Oracledat
WIDTH 80, 25
CLS
RANDOMIZE TIMER
DIM x$(64)
To.sound = 1
FOR x = 0 TO 63
READ x$(x)
NEXT x
m$ = "Not done"
pay = 0
WHILE m$ = "Not done"
pay = pay + 1
CLS
LOCATE 4, 1
PRINT " T H E O R A C L E !"
LOCATE 5, 1
PRINT " Computoman 2009"
FOR x = 1 TO 1500
NEXT x
LOCATE 7, 1
LINE INPUT "Please enter your question: ", q$
SELECT CASE LEFT$(q$, 1)
CASE CHR$(248)
To.sound = 1
CASE CHR$(255)
To.sound = 0
END SELECT
LOCATE 10, 1
PRINT "The Oracle will show you it's thoughts, then summon your answer."
LOCATE 12, 1
PRINT "So please be patient!"
LOCATE 15, 1
PRINT ""
LOCATE 16, 1
PRINT ""
LOCATE 17, 1
PRINT ""
FOR Z = 1 TO 100
LOCATE 16, 3
PRINT STRING$(75, " ");
LOCATE 16, 3
PRINT x$(RND(1) * 63);
IF To.sound = 1 THEN
rem PLAY "l16" + CHR$(INT(RND(1) * 7) + 65)
END IF
NEXT Z
FOR x = 1 TO 5
PRINT
NEXT x
INPUT "Are you done (Y/n)"; d$
IF UCASE$(d$) "N" THEN
m$ = "Done"
END IF
WEND
PRINT
PRINT "Please pay the cashier "; pay * 5; " dollars!"
zz$ = ""
zz$ = INPUT$(1)
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
endvofvjob:
VIEW PRINT
LOCATE 25, 1
PRINT STRING$(79, " ");
LOCATE 24, 1
EXIT SUB
END SUB

Posted by: computoman | October 9, 2009

Spreadsheet

Another oldie but goodie. Basic skeleton for a spreadsheet. Should work with freebasic using the qb option.

lc


' lizzycalc version -1
'
' updated March 1995 by computoman for qbasic.
' updated September 2009 by computoman for freebasic in qbasic mode
' last update: September 2009
'
' commands : description
'---------------:-----------------------------------------------
' "/'/^text : enter text in a current cell (left/right/middle just)
' =expression : enter number or formula in a current cell
' \text : repeat text up to cell width
' |fun : static special functions i. e. time, date, file
' : smv, or smh
' @func : real-time special functions of above
' c : change column width
' d : numeric data file of certain cells
' f : do file operations (load/save/new)
' h or ? : show this help screen
' i : insert row or column
' j : toggle form feed after print flag
' p : output results to file or printer without the border
' q : quit
' r : replicate a single cell multiple times
' s : output data to file or printer"
' u : toggle update screen flag
' arrow keys : move cursor in indicated direction
' expressions : numeric constant or cell id in form
' above items separated by operators +,-,*,^,|, or /
' evaluation is from left to right without operator
' preference. expressions are evaluated on enter and
' on the u command.
Start:
GOSUB Notice
GOSUB Housekeeping
WHILE Quit$ "Yes"
GOSUB Command.loop
WEND
GOSUB End.of.job
rem shell "sudo setterm -dump -file lc.txt"
END

Housekeeping:
' daffinitions
RANDOMIZE (TIMER)
ON ERROR GOTO Checkerror
Badfilename = 53
uit$ = "No"
Quote$ = CHR$(34)
Equal$ = "="
DEFINT I, N, W-Y
Updateflag = 1
Nilflag = 1
Equal = 1
Plus = 2
Minus = 3
Multiply = 4
Divide = 5
Exponent = 6
Root = 7
Moveup = 72
Moveleft = 75
Moveright = 77
Movedown = 80
Quit = 16
Scrdepth = 20 REM 20 is default to cga 45 is good for vga.
Scrwidth = 80
DIM Colwidth(27)
Colbase = 7: REM 7 and 10 work fine for 80 col screen.
Colwidth(0) = 4
FOR x = 1 TO 27
Colwidth(x) = Colbase
NEXT x
WIDTH Scrwidth, Scrdepth + 5
Maxcols = 27
Maxrows = Scrdepth
DIM D(Maxcols, Maxrows), D$(Maxcols, Maxrows), Dold$(Maxcols, Maxrows)
Operate$ = "=+-*/^|"
Numops = LEN(Operate$)
DIM O$(Numops)
FOR zz = 1 TO Numops
O$(zz) = MID$(Operate$, zz, 1)
NEXT zz
FOR x = 1 TO Maxcols
D$(x, 0) = CHR$(x + ASC("A") - 1) + SPACE$(Colwidth(Crsx) - 1)
NEXT x
FOR Y = 1 TO Maxrows
D$(0, Y) = SPACE$(Colwidth(Crsx) - 3) + RIGHT$(STR$(Y), 2) + " "
NEXT Y
Maxcols = Scrwidth / (Colwidth(0) + 1)
D$(0, 0) = " U" + SPACE$(Colwidth(Crsx) - 2)
bb = 0
FOR cc = 0 TO Crsx - 1
bb = bb + Colwidth(cc)
NEXT cc
bbb = 0
FOR ccc = 0 TO 27
bbb = bbb + Colwidth(ccc)
IF bbb >= 80 THEN
EXIT FOR
END IF
NEXT ccc
Maxcols = ccc - 1
GOSUB Printscreen
Crsx = 1
Crsy = 1
GOSUB Screenlocate
COLOR 0, 7
LOCATE Yloc, Xloc
PRINT SPACE$(Colwidth(Crsx));
COLOR 7, 0
RETURN

Command.loop:
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
In$ = ""
Ik = 0
LOCATE Scrdepth + 3, 1
PRINT "Command: ";
WHILE Ik &HD
i$ = ""
WHILE i$ = ""
i$ = INKEY$
WEND
Ik = ASC(i$)
SELECT CASE LEN(i$)
CASE 2
SELECT CASE ASC(RIGHT$(i$, 1))
CASE 33
GOSUB Fileroutine
GOSUB Printscreen
GOSUB Show.data
LOCATE Scrdepth + 3, 1
PRINT "Command: ";
CASE Quit
Quit$ = "Yes"
RETURN
CASE Moveup, Movedown, Moveleft, Moveright
GOSUB Movecursor
END SELECT
CASE 1
SELECT CASE Ik
CASE 8
GOSUB Processbackspace
CASE ELSE
IF Ik &HD THEN
PRINT i$;
In$ = In$ + i$
END IF
END SELECT
CASE 0
REM
END SELECT
WEND
'Evaluate.the.input.string:
C$ = LEFT$(In$, 1)
LOCATE Scrdepth + 4, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 4, 1
PRINT In$;
SELECT CASE UCASE$(C$)
CASE "'"
GOSUB Makeright
CASE "^"
GOSUB Makemiddle
CASE Quote$
GOSUB Forminput
CASE "\"
GOSUB Somerepeat
CASE "|"
GOSUB Funkey
CASE "I"
GOSUB Insertitin
CASE "D"
GOSUB Cellfill
CASE "@"
GOSUB Funcit
CASE "="
GOSUB Forminputa
CASE "U"
GOSUB Updatevalues
CASE "R"
GOSUB Replicatecell
CASE "S"
GOSUB Outdata
CASE "P"
GOSUB Hardcopy
CASE "J"
GOSUB SetFFflag
CASE "F"
GOSUB Fileroutine
CASE "H", "?"
GOSUB Do.Help
GOSUB Printscreen
CASE "C"
GOSUB Setcols
CASE "Q"
Quit$ = "Yes"
RETURN
CASE ""
Nilflag = 0
CASE ELSE
ER$ = "BAD input: " + In$
GOSUB Generaterror
END SELECT
LOCATE 1, 1
COLOR 0, 7
PRINT D$(0, 0);
COLOR 7, 0
IF Updateflag = 1 THEN
GOSUB Do.updatevalues
END IF
GOSUB Show.data
RETURN

End.of.job:
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
PRINT "Enter (S)ave data, or (Q)uit: ";
QQ$ = ""
WHILE QQ$ "S" AND QQ$ "Q" AND QQ$ CHR$(1 + 12)
QQ$ = UCASE$(INPUT$(1))
WEND
IF QQ$ CHR$(1 + 12) THEN
PRINT QQ$
END IF
IF QQ$ = "Q" OR QQ$ = CHR$(1 + 12) THEN
QQ$ = ""
END IF
IF QQ$ "" THEN
SELECT CASE UCASE$(QQ$)
CASE "S"
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
Datum$ = ""
INPUT "Enter file name: ", Datumf$
IF Datumf$ = "" THEN
RETURN
END IF
OPEN Datumf$ FOR OUTPUT AS #1
FOR ay = 1 TO 26
PRINT #1, Colwidth(ay)
NEXT ay
PRINT #1, Updateflag
PRINT #1, Nilflag
FOR ay = 1 TO Maxrows
FOR AX = 1 TO Maxcols
PRINT #1, AX
PRINT #1, ay
IF D$(AX, ay) = "" THEN
PRINT #1, D(AX, ay)
PRINT #1, ""
ELSE
PRINT #1, D(AX, ay)
PRINT #1, D$(AX, ay)
END IF
NEXT AX
NEXT ay
CLOSE #1
QQ$ = ""
END SELECT
END IF
rem CLS
PRINT "Lizzyclc (V.: -1) from computoman Independent Support Services"
PRINT STRING$(79, 196)
PRINT
PRINT "Thank you for using Lizzyclc."
PRINT "If you use this program more than several times and would like to"
PRINT "see more programs like the Lizzywrd, Lizzytrm, Lizzyclc, Lizzydb,"
PRINT "and Lizzycht then please send $1.00 or more to:"
PRINT
PRINT " Edward computoman dba"
PRINT " computoman Independent Support Services"
PRINT " 872 Strey Lane, Suite 518"
PRINT " Houston, Texas 77024"
PRINT
a$ = ""
WHILE a$ = ""
a$ = INPUT$(1)
WEND
RETURN

'=========================================================================
' subroutines
Movecursor:
'sub to move cursor
GOSUB Fixit
GOSUB Prepareoutput
SELECT CASE Ik
CASE Moveleft
' move left
IF Crsx > 1 THEN
Crsx = Crsx - 1
END IF
CASE Moveright
'move right
IF Crsx < Maxcols THEN
Crsx = Crsx + 1
END IF
CASE Movedown
' move down
IF Crsy 1 THEN
Crsy = Crsy - 1
END IF
END SELECT
GOSUB Show.data
RETURN

Screenlocate:
' sub to compute screen postion
bb = 0
FOR cc = 0 TO Crsx - 1
bb = bb + Colwidth(cc)
NEXT cc
Xloc = bb + 1
Yloc = Crsy + 1
RETURN

Processbackspace:
' sub to process backspace on command line
NEWLEN = LEN(In$) - 1
IF NEWLEN >= 0 THEN
GOSUB Commandlst
END IF
RETURN

Forminput:
' sub to formulate input
D(Crsx, Crsy) = 0
TEXTLEN = LEN(In$) - 1
IF TEXTLEN < 1 THEN
TEXTLEN = 1
END IF
IF RIGHT$(In$, 1) = Quote$ THEN
TEXTLEN = TEXTLEN - 1
END IF
Dold$(Crsx, Crsy) = In$
D$(Crsx, Crsy) = In$
GOSUB Showcell
RETURN

Forminputa:
'sub to formula input
V$ = In$
GOSUB Evaluateterm
IF ERRFLAG = 0 THEN
D$(Crsx, Crsy) = In$
Dold$(Crsx, Crsy) = In$
END IF
GOSUB Showcell
RETURN

Prepareoutput:
'SUB TO PREPARE OUTPUT
Dold$(Crsx, Crsy) = D$(Crsx, Crsy)
IF LEFT$(Dold$(Crsx, Crsy), 1) Quote$ THEN
SELECT CASE LEFT$(D$(Crsx, Crsy), 1)
CASE "="
V$ = RIGHT$(SPACE$(Colwidth(Crsx)) + STR$(D(Crsx, Crsy)), Colwidth(Crsx))
IF RIGHT$(Dold$(Crsx, Crsy), 1) = Quote$ THEN
Dold$(Crsx, Crsy) = LEFT$(Dold$(Crsx, Crsy), LEN(Dold$(Crsx, Crsy)) - 1)
END IF
IF RIGHT$(D$(Crsx, Crsy), 1) = Quote$ THEN
D$(Crsx, Crsy) = LEFT$(D$(Crsx, Crsy), LEN(D$(Crsx, Crsy)) - 1)
END IF
CASE "@"
SELECT CASE LCASE$(MID$(D$(Crsx, Crsy), 2, 4))
CASE "time"
V$ = TIME$
CASE "date"
V$ = DATE$
CASE "file"
V$ = Datumf$
CASE "smv("
Cntr1 = ASC(MID$(UCASE$(D$(Crsx, Crsy)), 6, 1)) - 64
Cntr2 = VAL(MID$(D$(Crsx, Crsy), 7, 2))
Cntr3 = VAL(MID$(D$(Crsx, Crsy), 9, 2))
D(Crsx, Crsy) = 0
FOR x = Cntr2 TO Cntr3
D(Crsx, Crsy) = D(Crsx, Crsy) + D(Cntr1, x)
NEXT x
V$ = RIGHT$(SPACE$(Colwidth(Crsx)) + STR$(D(Crsx, Crsy)), Colwidth(Crsx))
CASE "smh("
Cntr1 = ASC(MID$(UCASE$(D$(Crsx, Crsy)), 6, 1)) - 64
Cntr2 = VAL(MID$(D$(Crsx, Crsy), 7, 2))
Cntr3 = ASC(MID$(UCASE$(D$(Crsx, Crsy)), 9, 1)) - 64
D(Crsx, Crsy) = 0
FOR x = Cntr1 TO Cntr3
D(Crsx, Crsy) = D(Crsx, Crsy) + D(x, Cntr2)
NEXT x
V$ = RIGHT$(SPACE$(Colwidth(Crsx)) + STR$(D(Crsx, Crsy)), Colwidth(Crsx))
END SELECT
CASE "\"
Znrepeat$ = ""
Zrepeat$ = RIGHT$(D$(Crsx, Crsy), LEN(D$(Crsx, Crsy)) - 1)
FOR x = 1 TO Colwidth(Crsx)
Znrepeat$ = Znrepeat$ + Zrepeat$
NEXT x
V$ = LEFT$(Znrepeat$, Colwidth(Crsx))
CASE "'"
V$ = RIGHT$(SPACE$(Colwidth(Crsx)) + RIGHT$(D$(Crsx, Crsy), LEN(D$(Crsx, Crsy)) - 1), Colwidth(Crsx))
CASE "^"
V$ = RIGHT$(SPACE$(Colwidth(Crsx)) + RIGHT$(D$(Crsx, Crsy), LEN(D$(Crsx, Crsy)) - 1), INT(LEN(D$(Crsx, Crsy)) + Colwidth(Crsx)) / 2)
CASE ELSE
V$ = LEFT$(D$(Crsx, Crsy) + SPACE$(Colwidth(Crsx)), Colwidth(Crsx))
END SELECT
ELSE
IF LEN(V$) < Colwidth(Crsx) THEN
V$ = RIGHT$(D$(Crsx, Crsy), LEN(Dold$(Crsx, Crsy)) - 1) + SPACE$(Colwidth(Crsx))
ELSE
V$ = RIGHT$(D$(Crsx, Crsy), LEN(Dold$(Crsx, Crsy)) - 1)
END IF
END IF
IF D$(Crsx, Crsy) = "" THEN
D(Crsx, Crsy) = 0
END IF
V$ = LEFT$(V$ + SPACE$(Colwidth(Crsx)), Colwidth(Crsx))
RETURN

Evaluateterm:
' SUB TO EVALUATE EXPRESSION
ERRFLAG = 0
VI$ = V$
WHILE V$ ""
GOSUB Decodeoperator
IF ERRFLAG 0 THEN
ER$ = "BAD OPERATOR IN:" + VI$
GOSUB Generaterror
RETURN
END IF
GOSUB Decodeoperand
IF ERRFLAG 0 THEN
ER$ = "BAD FORMULA:" + VI$
GOSUB Generaterror
RETURN
END IF
SELECT CASE OPCODE
CASE IS = Equal
VL = V
CASE IS = Plus
VL = VL + V
CASE IS = Minus
VL = VL - V
CASE IS = Multiply
VL = VL * V
CASE IS = Divide
VL = VL / V
CASE IS = Exponent
VL = VL ^ V
CASE IS = Root
VL = VL ^ (1 / V)
END SELECT
WEND
D(Crsx, Crsy) = VL
RETURN

Decodeoperator:
' SUB TO DECODE OPERATOR
Op$ = LEFT$(V$, 1)
OPCODE = 0
FOR i = 1 TO Numops
IF Op$ = O$(i) THEN
OPCODE = i
i = Numops
V$ = MID$(V$, 2)
END IF
NEXT i
IF OPCODE = 0 THEN
ERRFLAG = 1
END IF
RETURN

Decodeoperand:
'SUB TO DECODE OPERAND
V = VAL(V$)
C$ = LEFT$(V$, 1)
ERRFLAG = 0
T = 0
IF V = 0 AND C$ "0" THEN
GOSUB Processcellnam
ELSE
GOSUB Processconstant
END IF
RETURN

Processconstant:
'SUB TO PROCESS AS A CONSTANT
IX = 1
IF C$ = "-" THEN
C$ = "0"
END IF
WHILE (C$ >= "0" AND C$ 32 THEN
C = C - 32
END IF
IF C Maxcols THEN
ERRFLAG = 1
RETURN
END IF
XC = C
C = 0
WHILE V$ "" AND C >= 0 AND C <= 9
V$ = MID$(V$, 2)
IF V$ "" THEN
C = ASC(V$) - ASC("0")
IF C >= 0 AND C Maxrows THEN
ERRFLAG = 1
RETURN
END IF
YC = T
V = D(XC, YC)
RETURN

Generaterror:
' SUB TO GENERATE GENERAL ERROR REPORT
LOCATE Scrdepth + 4, 1
PRINT ER$ + " ";
BEEP
WHILE INKEY$ = ""
WEND
LOCATE Scrdepth + 4, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 4, 1
PRINT CHR$(64 + Crsx); LTRIM$(RTRIM$(STR$(Crsy))); ": "; D$(Crsx, Crsy);
RETURN

Updatevalues:
' sub to update formula values
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
PRINT "Enter Automatic update (O)n or o(F)f: ";
QQ$ = ""
WHILE QQ$ "O" AND QQ$ "F" AND QQ$ "Q" AND QQ$ CHR$(1 + 12)
QQ$ = UCASE$(INPUT$(1))
WEND
IF QQ$ CHR$(1 + 12) THEN
PRINT QQ$
END IF
SELECT CASE UCASE$(QQ$)
CASE "O"
Updateflag = 1
MID$(D$(0, 0), 2, 1) = "U"
CASE "F"
Updateflag = 0
MID$(D$(0, 0), 2, 1) = " "
END SELECT
RETURN

Do.updatevalues:
LOCATE Scrdepth + 4, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 4, 1
PRINT "Caculating!";
LOCATE 1, 1
Tempy = Crsy
Tempx = Crsx
FOR Crsy = 1 TO Maxrows
LOCATE Crsy + 1, Colwidth(0) + 1
FOR Crsx = 1 TO Maxcols
IF LEFT$(Dold$(Crsx, Crsy), 1) Quote$ AND LEFT$(Dold$(Crsx, Crsy), 1) "\" THEN
SELECT CASE LEFT$(D$(Crsx, Crsy), 1)
CASE "="
V$ = D$(Crsx, Crsy)
GOSUB Evaluateterm
END SELECT
ELSE
V$ = RIGHT$(D$(Crsx, Crsy), Colwidth(Crsx))
END IF
GOSUB Screenlocate
LOCATE Yloc, Xloc
GOSUB Prepareoutput
PRINT LEFT$(V$, Colwidth(Crsx));
IF POS(0) + Colwidth(Crsx + 1) > 80 THEN
EXIT FOR
END IF
NEXT Crsx
NEXT Crsy
Crsx = Tempx
Crsy = Tempy
GOSUB Screenlocate
GOSUB Showcell
LOCATE Scrdepth + 4, 1
PRINT STRING$(79, " ");
LOCATE Scrdepth + 4, 1
PRINT CHR$(64 + Crsx); LTRIM$(RTRIM$(STR$(Crsy))); " "; D$(Crsx, Crsy);
RETURN

Showcell:
' sub to show current cell value
GOSUB Screenlocate
GOSUB Prepareoutput
COLOR 0, 7
LOCATE Yloc, Xloc
PRINT V$;
COLOR 7, 0
RETURN

Fileroutine:
'--
' (F)ile routine
'--
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
PRINT "Enter (L)oad data, (S)ave data, (N)ew, or (Q)uit: ";
QQ$ = ""
WHILE QQ$ "L" AND QQ$ "S" AND QQ$ "Q" AND QQ$ "N" AND QQ$ CHR$(1 + 12)
QQ$ = UCASE$(INPUT$(1))
WEND
IF QQ$ CHR$(1 + 12) THEN
PRINT QQ$
END IF
IF QQ$ = "Q" OR QQ$ = CHR$(1 + 12) THEN
QQ$ = ""
END IF
IF QQ$ "" THEN
IF QQ$ "N" THEN
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
Datum$ = ""
INPUT "Enter file name: ", Datumf$
IF Datumf$ = "" THEN
RETURN
END IF
END IF
SELECT CASE UCASE$(QQ$)
CASE "L"
OPEN Datumf$ FOR INPUT AS #1
FOR ay = 1 TO 26
INPUT #1, Colwidth(ay)
NEXT ay
INPUT #1, Updateflag
INPUT #1, Nilflag
WHILE NOT EOF(1)
INPUT #1, FX
INPUT #1, FY
INPUT #1, D(FX, FY)
LINE INPUT #1, D$(FX, FY)
WEND
CLOSE #1
QQ$ = ""
IF Updateflag = 0 THEN
GOSUB Do.updatevalues
END IF
GOSUB Printscreen
CASE "N"
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
PRINT "Are you sure (Y/N): ";
QQ1$ = ""
WHILE QQ1$ "Y" AND QQ1$ "N"
QQ1$ = UCASE$(INPUT$(1))
WEND
PRINT QQ1$
IF QQ1$ = "Y" THEN
FOR Poo1 = 1 TO Maxcols
FOR Poo2 = 1 TO Maxrows
D(Poo1, Poo2) = 0
D$(Poo1, Poo2) = ""
Dold$(Poo1, Poo2) = ""
NEXT Poo2
NEXT Poo1
GOSUB Do.updatevalues
END IF
CASE "S"
OPEN Datumf$ FOR OUTPUT AS #1
FOR ay = 1 TO 26
PRINT #1, Colwidth(ay)
NEXT ay
PRINT #1, Updateflag
PRINT #1, Nilflag
FOR ay = 1 TO Maxrows
FOR AX = 1 TO Maxcols
PRINT #1, AX
PRINT #1, ay
IF D$(AX, ay) = "" THEN
PRINT #1, D(AX, ay)
PRINT #1, ""
ELSE
PRINT #1, D(AX, ay)
PRINT #1, D$(AX, ay)
END IF
NEXT AX
NEXT ay
CLOSE #1
QQ$ = ""
END SELECT
END IF
RETURN

Printscreen:
' sub to print screen
CLS
DD = 0
Tempy = Crsy
Tempx = Crsx
LOCATE Scrdepth + 5, 11
PRINT "LIZZYCALC version -1 from computoman Independent Support Services"
LOCATE 1, 1
FOR Crsy = 0 TO Maxrows
LOCATE Crsy + 1, 1
FOR Crsx = 0 TO Maxcols
GOSUB Prepareoutput
IF Crsx = 0 OR Crsy = 0 THEN
COLOR 0, 7
ELSE
COLOR 7, 0
END IF
PRINT V$;
IF Crsx = 0 OR Crsy = 0 THEN
COLOR 7, 0
ELSE
COLOR 0, 7
END IF
IF POS(0) + Colwidth(Crsx + 1) > 80 THEN
EXIT FOR
END IF
NEXT Crsx
NEXT Crsy
COLOR 7, 0
Crsx = Tempx
Crsy = Tempy
LOCATE Scrdepth + 2, 1
PRINT SPACE$(79);
RETURN

Commandlst:
In$ = LEFT$(In$, NEWLEN)
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
PRINT "Command: "; In$;
RETURN

Fixit:
' fix i$
Ik = ASC(RIGHT$(i$, 1))
RETURN

It:
REM
RETURN

Show.data:
LOCATE Yloc, Xloc
PRINT V$;
LOCATE Scrdepth + 4, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 4, 1
PRINT CHR$(64 + Crsx); LTRIM$(RTRIM$(STR$(Crsy))); ": "; LTRIM$(RTRIM$(STR$(D(Crsx, Crsy)))); ", "; D$(Crsx, Crsy);
GOSUB Showcell
LOCATE Scrdepth + 3, LEN(In$) + 10
RETURN

Somerepeat:
Znrepeat$ = ""
Zin$ = In$
Zrepeat$ = RIGHT$(In$, LEN(In$) - 1)
FOR x = 1 TO Colwidth(Crsx)
Znrepeat$ = Znrepeat$ + Zrepeat$
NEXT x
V$ = LEFT$(Znrepeat$, Colwidth(Crsx) + 1)
Dold$(Crsx, Crsy) = Zin$
D$(Crsx, Crsy) = Zin$
GOSUB Forminput
RETURN

Replicatecell:
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
INPUT "Enter cell to replicate: ", Cell$
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
INPUT "Enter where to start copy: ", Cellstart$
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
INPUT "Enter where to end copy: ", Cellend$
Cellcol = ASC(LEFT$(UCASE$(Cell$), 1)) - 64
Cellrow = VAL(RIGHT$(Cell$, LEN(Cell$) - 1))
Cellstartcol = ASC(LEFT$(UCASE$(Cellstart$), 1)) - 64
Cellstartrow = VAL(RIGHT$(Cellstart$, LEN(Cellstart$) - 1))
Cellendcol = ASC(LEFT$(UCASE$(Cellend$), 1)) - 64
Cellendrow = VAL(RIGHT$(Cellend$, LEN(Cellend$) - 1))
D$(Cellcol, Cellrow) = Dold$(Cellcol, Cellrow)
FOR Cellcountcol = Cellstartcol TO Cellendcol
FOR Cellcountrow = Cellstartrow TO Cellendrow
snaker = Cellcountrow - Cellrow
snakec = Cellcountcol - Cellcol
SELECT CASE LEFT$(D$(Cellcol, Cellrow), 1)
CASE "@"
SELECT CASE MID$(LCASE$(D$(Cellcol, Cellrow)), 2, 3)
CASE "smv"
snk1$ = CHR$(ASC(MID$(D$(Cellcol, Cellrow), 6, 1)) + snakec)
snake$ = snk1$ + MID$(D$(Cellcol, Cellrow), 7, 4)
D$(Cellcountcol, Cellcountrow) = "@smv(" + snake$ + ")"
Dold$(Cellcountcol, Cellcountrow) = D$(Cellcountcol, Cellcountrow)
In$ = D$(Cellcountcol, Cellcountrow)
CASE "smh"
snk1$ = MID$(D$(Cellcol, Cellrow), 6, 1)
snk2$ = RIGHT$("0" + LTRIM$(RTRIM$(STR$(VAL(MID$(D$(Cellcol, Cellrow), 7, 2)) + snaker))), 2)
snk3$ = MID$(D$(Cellcol, Cellrow), 9, 1)
snake$ = snk1$ + snk2$ + snk3$
D$(Cellcountcol, Cellcountrow) = "@smh(" + snake$ + ")"
Dold$(Cellcountcol, Cellcountrow) = D$(Cellcountcol, Cellcountrow)
In$ = D$(Cellcountcol, Cellcountrow)
END SELECT
CASE "="
Passing$ = ""
FOR x = 1 TO LEN(D$(Cellcol, Cellrow))
SELECT CASE MID$(LCASE$(D$(Cellcol, Cellrow)), x, 1)
CASE "+", "=", "-", "*", "/", "^", "|"
Passing$ = Passing$ + MID$(D$(Cellcol, Cellrow), x, 1)
CASE "a" TO "z"
Passing$ = Passing$ + CHR$(ASC(MID$(D$(Cellcol, Cellrow), x, 1)) + snakec)
CASE "0" TO "9"
SELECT CASE MID$(LCASE$(D$(Cellcol, Cellrow)), x - 1, 1)
CASE "a" TO "z"
Passingnum$ = ""
FOR Y = x TO LEN(D$(Cellcol, Cellrow))
Passpoo$ = MID$(D$(Cellcol, Cellrow), Y, 1)
IF Passpoo$ "9" THEN
EXIT FOR
END IF
Passingnum$ = Passingnum$ + Passpoo$
x = x + 1
NEXT Y
x = x - 1
Passing$ = Passing$ + RIGHT$("0" + LTRIM$(RTRIM$(STR$(VAL(Passingnum$) + snaker))), 2)
CASE ELSE
Passingnum$ = ""
FOR Y = x TO LEN(D$(Cellcol, Cellrow))
Passpoo$ = MID$(D$(Cellcol, Cellrow), Y, 1)
IF Passpoo$ "9" THEN
EXIT FOR
END IF
Passingnum$ = Passingnum$ + Passpoo$
x = x + 1
NEXT Y
x = x - 1
Passing$ = Passing$ + Passingnum$
END SELECT
END SELECT
NEXT x
D$(Cellcountcol, Cellcountrow) = Passing$
Dold$(Cellcountcol, Cellcountrow) = D$(Cellcountcol, Cellcountrow)
In$ = D$(Cellcountcol, Cellcountrow)
CASE ELSE
Dold$(Cellcountcol, Cellcountrow) = Dold$(Cellcol, Cellrow)
D$(Cellcountcol, Cellcountrow) = D$(Cellcol, Cellrow)
In$ = D$(Cellcol, Cellrow)
END SELECT
NEXT Cellcountrow
NEXT Cellcountcol
GOSUB Do.updatevalues
RETURN

Do.Help:
CLS
PRINT " LIZZYCALC version -1 HELP screen"
PRINT ""
PRINT " commands : description"
PRINT "---------------:-----------------------------------------------"
PRINT " "; CHR$(34); "/'/^text : enter text (left/right/middle justified) in a current cell"
PRINT " =expression : enter number or formula in a current cell"
PRINT " \text : repeat text up to cell width"
PRINT " |fun or @func : functions; i. e. time, date, file, smv(cornr), or smh(corc)"
PRINT " c : change column width"
PRINT " d : numeric data fill of certain cells"
PRINT " f : do file operations (load/save/new)"
PRINT " i : insert column or row"
PRINT " j : toggle form feed after print flag"
PRINT " n : new spreadsheet (wipe away page forever)"
PRINT " p : output results to file or printer without a border"
PRINT " q : quit"
PRINT " r : replicate a single cell multiple times"
PRINT " s : output data to file or printer"
PRINT " u : toggle update screen flag"
PRINT " arrow keys : move cursor in indicated direction"
PRINT " expressions : numeric constant or cell id in form
"
PRINT " above items separated by operators +,-,*,^,|, or /"
PRINT " evaluation is from left to right without operator preference."
PRINT "--------------------------------------------------------------------------";
Booboo$ = INPUT$(1)
IF Updateflag = 0 THEN
GOSUB Printscreen
END IF
RETURN

Notice:
CLS
PRINT
PRINT
PRINT "] LIZZYCALC Version -1"
PRINT "]"
PRINT "]This is a beta version program."
PRINT "]Please use with caution and patience."
PRINT "]"
PRINT "]Thank you,"
PRINT "]the computoman"
PRINT "]computoman Independent Support Services"
PRINT
PRINT "Press any key to continue: _";
Booboo$ = ""
WHILE Booboo$ = ""
Booboo$ = INKEY$
rem SOUND 500, .1
FOR x& = 1 TO 40000
NEXT x&
rem SOUND 2000, .1
FOR x& = 1 TO 40000
NEXT x&
WEND
PRINT Booboo$
RETURN

Hardcopy:
Tempy = Crsy
Tempx = Crsx
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
PRINT "Enter (P)rint or (Q)uit: ";
QQ$ = ""
WHILE QQ$ "P" AND QQ$ "Q" AND QQ$ CHR$(1 + 12)
QQ$ = UCASE$(INPUT$(1))
WEND
IF QQ$ CHR$(1 + 12) THEN
PRINT QQ$
END IF
IF QQ$ = "P" AND (QQ$ "Q" OR QQ$ CHR$(1 + 12)) THEN
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
INPUT "Enter where to start print: ", Cellstart$
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
INPUT "Enter where to end print: ", Cellend$
Cellstartcol = ASC(LEFT$(UCASE$(Cellstart$), 1)) - 64
Cellstartrow = VAL(RIGHT$(Cellstart$, LEN(Cellstart$) - 1))
Cellendcol = ASC(LEFT$(UCASE$(Cellend$), 1)) - 64
Cellendrow = VAL(RIGHT$(Cellend$, LEN(Cellend$) - 1))
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
Datum$ = ""
INPUT "Enter file name (prn for printer): ", Datum$
Datum$ = LCASE$(Datum$)
IF Datum$ = "" THEN
Datum$ = "prn"
END IF
IF Datum$ = "con" THEN
CLS
END IF
'sub to print screen
OPEN Datum$ FOR OUTPUT AS #2
DD = 0
FOR Cellcountrow = Cellstartrow TO Cellendrow
FOR Cellcountcol = Cellstartcol TO Cellendcol
Crsx = Cellcountcol
Crsy = Cellcountrow
GOSUB Prepareoutput
IF Crsy = 0 OR Crsx = 0 THEN
REM
ELSE
PRINT #2, V$;
END IF
NEXT Cellcountcol
PRINT #2, ""
NEXT Cellcountrow
LOCATE Scrdepth + 2, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 2, 1
IF FFflag = 1 THEN
SELECT CASE Datum$
CASE "prn"
PRINT #2, CHR$(12)
CASE "con"
CLS
CASE ELSE
PRINT #2, CHR$(12)
END SELECT
ELSEIF Datum$ = "con" THEN
PRINT "Press to continue";
doopoo$ = INPUT$(1)
END IF
CLOSE #2
END IF
Crsx = Tempx
Crsy = Tempy
LOCATE Scrdepth + 2, 1
PRINT SPACE$(79);
RETURN

SetFFflag:
IF FFflag = 0 THEN
FFflag = 1
MID$(D$(0, 0), 1, 1) = "J"
ELSEIF FFflag = 1 THEN
FFflag = 0
MID$(D$(0, 0), 1, 1) = " "
END IF
RETURN

Funkey:
SELECT CASE LCASE$(MID$(In$, 2, 3))
CASE "tim"
D$(Crsx, Crsy) = Quote$ + TIME$
Dold$(Crsx, Crsy) = D$(Crsx, Crsy)
CASE "dat"
D$(Crsx, Crsy) = Quote$ + DATE$
Dold$(Crsx, Crsy) = D$(Crsx, Crsy)
CASE "fil"
D$(Crsx, Crsy) = Quote$ + Datumf$
Dold$(Crsx, Crsy) = D$(Crsx, Crsy)
END SELECT
RETURN

Funcit:
D(Crsx, Crsy) = 0
Dold$(Crsx, Crsy) = In$
D$(Crsx, Crsy) = In$
RETURN

Setcols:
Tempy = Crsy
Tempx = Crsx
Colchoose$ = ""
WHILE UCASE$(Colchoose$) "Z"
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
INPUT "Column to change: ", Colchoose$
WEND
Colchoose = ASC(UCASE$(Colchoose$)) - 64
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
INPUT "Enter new cell width: ", Colwidth(Colchoose)
Scrdepth = 45
Crsx = Tempx
Crsy = Tempy
bb = 0
FOR cc = 0 TO Crsx - 1
bb = bb + Colwidth(cc)
NEXT cc
bbb = 0
FOR ccc = 0 TO 27
bbb = bbb + Colwidth(ccc)
IF bbb >= 80 THEN
EXIT FOR
END IF
NEXT ccc
Maxcols = ccc - 1
GOSUB Printscreen
LOCATE Scrdepth + 2, 1
PRINT SPACE$(79);
RETURN

Outdata:
Tempy = Crsy
Tempx = Crsx
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
PRINT "Enter (S)end data or (Q)uit: ";
QQ$ = ""
WHILE QQ$ "S" AND QQ$ "Q" AND QQ$ CHR$(1 + 12)
QQ$ = UCASE$(INPUT$(1))
WEND
IF QQ$ CHR$(1 + 12) THEN
PRINT QQ$
END IF
IF QQ$ = "S" AND (QQ$ "Q" OR QQ$ CHR$(1 + 12)) THEN
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
INPUT "Enter where to start print: ", Cellstart$
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
INPUT "Enter where to end print: ", Cellend$
Cellstartrow = ASC(LEFT$(UCASE$(Cellstart$), 1)) - 64
Cellstartcol = VAL(RIGHT$(Cellstart$, LEN(Cellstart$) - 1))
Cellendrow = ASC(LEFT$(UCASE$(Cellend$), 1)) - 64
Cellendcol = VAL(RIGHT$(Cellend$, LEN(Cellend$) - 1))
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
Datum$ = ""
INPUT "Enter file name (prn for printer): ", Datum$
Datum$ = LCASE$(Datum$)
IF Datum$ = "" THEN
Datum$ = "prn"
END IF
IF Datum$ = "con" THEN
CLS
END IF
'sub to print screen
OPEN Datum$ FOR OUTPUT AS #2
DD = 0
PRINT #2, "File: " + Datumf$
FOR Cellcountrow = Cellstartrow TO Cellendrow
FOR Cellcountcol = Cellstartcol TO Cellendcol
Crsx = Cellcountcol
Crsy = Cellcountrow
IF Crsy = 0 OR Crsx = 0 THEN
REM
ELSE
PRINT #2, CHR$(64 + Cellcountrow) + RTRIM$(LTRIM$(STR$(Cellcountcol))) + ": " + D$(Cellcountrow, Cellcountcol)
END IF
NEXT Cellcountcol
NEXT Cellcountrow
LOCATE Scrdepth + 2, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 2, 1
IF FFflag = 1 THEN
SELECT CASE Datum$
CASE "prn"
PRINT #2, CHR$(12)
CASE "con"
CLS
CASE ELSE
PRINT #2, CHR$(12)
END SELECT
ELSEIF Datum$ = "con" THEN
PRINT "Press to continue";
doopoo$ = INPUT$(1)
END IF
CLOSE #2
END IF
Crsx = Tempx
Crsy = Tempy
LOCATE Scrdepth + 2, 1
PRINT SPACE$(79);
RETURN

Makeright:
V$ = RIGHT$(SPACE$(Colwidth(Crsx)) + D$(Crsx, Crsy), Colwidth(Crsx))
GOSUB Forminput
RETURN

Makemiddle:
V$ = RIGHT$(SPACE$(Colwidth(Crsx)) + D$(Crsx, Crsy), INT(LEN(D$(Crsx, Crsy)) + Colwidth(Crsx)) / 2)
GOSUB Forminput
RETURN

Cellfill:
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
INPUT "Enter where to start fill: ", Cellstart$
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
INPUT "Enter where to end fill: ", Cellend$
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
INPUT "Enter start value: ", Startvalue
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
INPUT "Enter increment: ", Increment
Cellstartcol = ASC(LEFT$(UCASE$(Cellstart$), 1)) - 64
Cellstartrow = VAL(RIGHT$(Cellstart$, LEN(Cellstart$) - 1))
Cellendcol = ASC(LEFT$(UCASE$(Cellend$), 1)) - 64
Cellendrow = VAL(RIGHT$(Cellend$, LEN(Cellend$) - 1))
Dummyvalue = Startvalue - Increment
FOR Cellcountcol = Cellstartcol TO Cellendcol
FOR Cellcountrow = Cellstartrow TO Cellendrow
Dummyvalue = Dummyvalue + Increment
D$(Cellcountcol, Cellcountrow) = "=" + LTRIM$(RTRIM$(STR$(Dummyvalue)))
Dold$(Cellcountcol, Cellcountrow) = D$(Cellcountcol, Cellcountrow)
In$ = D$(Cellcountcol, Cellcountrow)
NEXT Cellcountrow
NEXT Cellcountcol
GOSUB Do.updatevalues
RETURN

Insertitin:
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
PRINT "Insert (C)olumn, or (R)ow: ";
QQ$ = ""
WHILE QQ$ "C" AND QQ$ "R" AND QQ$ "Q" AND QQ$ CHR$(1 + 12)
QQ$ = UCASE$(INPUT$(1))
WEND
IF QQ$ CHR$(1 + 12) THEN
PRINT QQ$
END IF
IF QQ$ = "Q" OR QQ$ = CHR$(1 + 12) THEN
QQ$ = ""
END IF
IF QQ$ "" THEN
SELECT CASE QQ$
CASE "C"
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
INPUT "Enter Column where to insert: ", Insertcol$
Cellstart$ = Insertcol$ + "01"
Cellend$ = CHR$(Maxcols + 1 + 64) + "45"
Cellstartcol = ASC(LEFT$(UCASE$(Cellstart$), 1)) - 64
Cellstartrow = VAL(RIGHT$(Cellstart$, LEN(Cellstart$) - 1))
Cellendcol = ASC(LEFT$(UCASE$(Cellend$), 1)) - 64
Cellendrow = VAL(RIGHT$(Cellend$, LEN(Cellend$) - 1))
FOR Cellcountcol = Cellendcol TO Cellstartcol STEP -1
FOR Cellcountrow = Cellstartrow TO Cellendrow
IF Cellcountcol Cellstartcol THEN
Cell$ = D$(Cellcountcol - 1, Cellcountrow)
Cellcol = Cellcountcol - 1
Cellrow = Cellcountrow
snaker = Cellcountrow - Cellrow
snakec = Cellcountcol - Cellcol
SELECT CASE LEFT$(D$(Cellcol, Cellrow), 1)
CASE "@"
SELECT CASE MID$(LCASE$(D$(Cellcol, Cellrow)), 2, 3)
CASE "smv"
snk1$ = CHR$(ASC(MID$(D$(Cellcol, Cellrow), 6, 1)) + 1): 'snakec)
snake$ = snk1$ + MID$(D$(Cellcol, Cellrow), 7, 4)
D$(Cellcountcol, Cellcountrow) = "@smv(" + snake$ + ")"
CASE "smh"
snk1$ = MID$(D$(Cellcol, Cellrow), 6, 1)
snk2$ = RIGHT$("0" + LTRIM$(RTRIM$(STR$(VAL(MID$(D$(Cellcol, Cellrow), 7, 2)) + snaker))), 2)
snk3$ = MID$(D$(Cellcol, Cellrow), 9, 1)
snake$ = snk1$ + snk2$ + snk3$
D$(Cellcountcol, Cellcountrow) = "@smh(" + snake$ + ")"
FOR x = 5 TO LEN(D$(Cellcountcol, Cellcountrow))
garfunc$ = MID$(D$(Cellcountcol, Cellcountrow), x, 1)
SELECT CASE UCASE$(garfunc$)
CASE "A" TO "Z"
MID$(D$(Cellcountcol, Cellcountrow), x, 1) = CHR$(ASC(garfunc$) + 1)
END SELECT
NEXT x
CASE ELSE
D$(Cellcountcol, Cellcountrow) = D$(Cellcountcol - 1, Cellcountrow)
END SELECT
Dold$(Cellcountcol, Cellcountrow) = D$(Cellcountcol, Cellcountrow)
In$ = D$(Cellcountcol, Cellcountrow)
CASE "="
Passing$ = ""
FOR x = 1 TO LEN(D$(Cellcol, Cellrow))
SELECT CASE MID$(LCASE$(D$(Cellcol, Cellrow)), x, 1)
CASE "+", "=", "-", "*", "/", "^", "|"
Passing$ = Passing$ + MID$(D$(Cellcol, Cellrow), x, 1)
CASE "a" TO "z"
Passing$ = Passing$ + CHR$(ASC(MID$(D$(Cellcol, Cellrow), x, 1)) + snakec)
CASE "0" TO "9"
SELECT CASE MID$(LCASE$(D$(Cellcol, Cellrow)), x - 1, 1)
CASE "a" TO "z"
Passingnum$ = ""
FOR Y = x TO LEN(D$(Cellcol, Cellrow))
Passpoo$ = MID$(D$(Cellcol, Cellrow), Y, 1)
IF Passpoo$ "9" THEN
EXIT FOR
END IF
Passingnum$ = Passingnum$ + Passpoo$
x = x + 1
NEXT Y
x = x - 1
Passing$ = Passing$ + RIGHT$("0" + LTRIM$(RTRIM$(STR$(VAL(Passingnum$) + snaker))), 2)
CASE ELSE
Passingnum$ = ""
FOR Y = x TO LEN(D$(Cellcol, Cellrow))
Passpoo$ = MID$(D$(Cellcol, Cellrow), Y, 1)
IF Passpoo$ "9" THEN
EXIT FOR
END IF
Passingnum$ = Passingnum$ + Passpoo$
x = x + 1
NEXT Y
x = x - 1
Passing$ = Passing$ + Passingnum$
END SELECT
END SELECT
NEXT x
D$(Cellcountcol, Cellcountrow) = Passing$
Dold$(Cellcountcol, Cellcountrow) = D$(Cellcountcol, Cellcountrow)
In$ = D$(Cellcountcol, Cellcountrow)
CASE ELSE
Dold$(Cellcountcol, Cellcountrow) = Dold$(Cellcol, Cellrow)
D$(Cellcountcol, Cellcountrow) = D$(Cellcol, Cellrow)
In$ = D$(Cellcountcol, Cellcountrow)
END SELECT
ELSE
D$(Cellcountcol, Cellcountrow) = ""
D(Cellcountcol, Cellcountrow) = 0
END IF
Dold$(Cellcountcol, Cellcountrow) = D$(Cellcountcol, Cellcountrow)
In$ = D$(Cellcountcol, Cellcountrow)
NEXT Cellcountrow
NEXT Cellcountcol
GOSUB Do.updatevalues
CASE "R"
LOCATE Scrdepth + 3, 1
PRINT SPACE$(79);
LOCATE Scrdepth + 3, 1
INPUT "Enter row where to insert: ", Insertrow
Rowstart$ = RIGHT$("0" + LTRIM$(RTRIM$(STR$(Insertrow))), 2)
Cellstart$ = "A" + Rowstart$
Cellend$ = CHR$(Maxcols + 1 + 64) + "45"
Cellstartcol = ASC(LEFT$(UCASE$(Cellstart$), 1)) - 64
Cellstartrow = VAL(RIGHT$(Cellstart$, LEN(Cellstart$) - 1))
Cellendcol = ASC(LEFT$(UCASE$(Cellend$), 1)) - 64
Cellendrow = VAL(RIGHT$(Cellend$, LEN(Cellend$) - 1))
FOR Cellcountcol = Cellstartcol TO Cellendcol
FOR Cellcountrow = Cellendrow TO Cellstartrow STEP -1
IF Cellcountrow Cellstartrow THEN
Cell$ = D$(Cellcountcol, Cellcountrow - 1)
Cellcol = Cellcountcol
Cellrow = Cellcountrow - 1
snaker = Cellcountrow - Cellrow
snakec = Cellcountcol - Cellcol
SELECT CASE LEFT$(D$(Cellcol, Cellrow), 1)
CASE "@"
SELECT CASE MID$(LCASE$(D$(Cellcol, Cellrow)), 2, 3)
CASE "smv"
snk1$ = CHR$(ASC(MID$(D$(Cellcol, Cellrow), 6, 1)) + snakec)
snake$ = snk1$ + MID$(D$(Cellcol, Cellrow), 7, 4)
D$(Cellcountcol, Cellcountrow) = "@smv(" + snake$ + ")"
MID$(D$(Cellcountcol, Cellcountrow), 7, 2) = RIGHT$("0" + LTRIM$(RTRIM$(STR$(VAL(MID$(D$(Cellcountcol, Cellcountrow), 7, 2)) + 1))), 2)
MID$(D$(Cellcountcol, Cellcountrow), 9, 2) = RIGHT$("0" + LTRIM$(RTRIM$(STR$(VAL(MID$(D$(Cellcountcol, Cellcountrow), 9, 2)) + 1))), 2)
CASE "smh"
snk1$ = MID$(D$(Cellcol, Cellrow), 6, 1)
snk2$ = RIGHT$("0" + LTRIM$(RTRIM$(STR$(VAL(MID$(D$(Cellcol, Cellrow), 7, 2)) + 1))), 2): '+snaker
snk3$ = MID$(D$(Cellcol, Cellrow), 9, 1)
snake$ = snk1$ + snk2$ + snk3$
D$(Cellcountcol, Cellcountrow) = "@smh(" + snake$ + ")"
CASE ELSE
D$(Cellcountcol, Cellcountrow) = D$(Cellcountcol, Cellcountrow - 1)
END SELECT
Dold$(Cellcountcol, Cellcountrow) = D$(Cellcountcol, Cellcountrow)
In$ = D$(Cellcountcol, Cellcountrow)
CASE "="
Passing$ = ""
FOR x = 1 TO LEN(D$(Cellcol, Cellrow))
SELECT CASE MID$(LCASE$(D$(Cellcol, Cellrow)), x, 1)
CASE "+", "=", "-", "*", "/", "^", "|"
Passing$ = Passing$ + MID$(D$(Cellcol, Cellrow), x, 1)
CASE "a" TO "z"
Passing$ = Passing$ + CHR$(ASC(MID$(D$(Cellcol, Cellrow), x, 1)) + snakec)
CASE "0" TO "9"
SELECT CASE MID$(LCASE$(D$(Cellcol, Cellrow)), x - 1, 1)
CASE "a" TO "z"
Passingnum$ = ""
FOR Y = x TO LEN(D$(Cellcol, Cellrow))
Passpoo$ = MID$(D$(Cellcol, Cellrow), Y, 1)
IF Passpoo$ "9" THEN
EXIT FOR
END IF
Passingnum$ = Passingnum$ + Passpoo$
x = x + 1
NEXT Y
x = x - 1
Passing$ = Passing$ + RIGHT$("0" + LTRIM$(RTRIM$(STR$(VAL(Passingnum$) + snaker))), 2)
CASE ELSE
Passingnum$ = ""
FOR Y = x TO LEN(D$(Cellcol, Cellrow))
Passpoo$ = MID$(D$(Cellcol, Cellrow), Y, 1)
IF Passpoo$ "9" THEN
EXIT FOR
END IF
Passingnum$ = Passingnum$ + Passpoo$
x = x + 1
NEXT Y
x = x - 1
Passing$ = Passing$ + Passingnum$
END SELECT
END SELECT
NEXT x
D$(Cellcountcol, Cellcountrow) = Passing$
Dold$(Cellcountcol, Cellcountrow) = D$(Cellcountcol, Cellcountrow)
In$ = D$(Cellcountcol, Cellcountrow)
CASE ELSE
Dold$(Cellcountcol, Cellcountrow) = Dold$(Cellcol, Cellrow)
D$(Cellcountcol, Cellcountrow) = D$(Cellcol, Cellrow)
In$ = D$(Cellcol, Cellrow)
END SELECT
ELSE
D$(Cellcountcol, Cellcountrow) = ""
D(Cellcountcol, Cellcountrow) = 0
END IF
Dold$(Cellcountcol, Cellcountrow) = D$(Cellcountcol, Cellcountrow)
In$ = D$(Cellcountcol, Cellcountrow)
NEXT Cellcountrow
NEXT Cellcountcol
GOSUB Do.updatevalues
END SELECT
END IF
RETURN

Checkerror:
SELECT CASE ERR
CASE 52, Badfilename
rem RESUME Fileroutine
end
END SELECT
END

Posted by: computoman | October 8, 2009

Modifiable text adventure

So,ple text adventure that can be compile with FreeBasic which is available on several platforms. . You could certainly add graphics and sound if you wanted to or use the code modified as a game engine. Have fun!
[=========== code starts after this line =================]

DECLARE FUNCTION score! ()
DECLARE FUNCTION whichway! ()
DECLARE FUNCTION bittest! (a!, b!)
DECLARE SUB describe (dir)
COMMON SHARED dchar$, n, s, e, w, u, d, false, true, cooked
COMMON SHARED done, quit, eaten, awake, turns, start, flames
COMMON SHARED ff, ew, nw, ne, sew, nonly, nsew, newud, sw, ns, donly
COMMON SHARED dn, ud, su
'
' Updated to work in basic
' By Computoman
' On 03/31/94
'
' This will work in any resolution making compatabilities with televisions
' livable.
'
' Approximate 1000 lines of code
'
REM initialize
REM constants
false = 0
true = -1
ff = 12
ew = 12
nw = 9
ne = 5
sew = 14
nonly = 1
nsew = 15
newud = 61
sw = 10
ns = 3
donly = 32
dn = 33
ud = 48
su = 18
'
n = 1
s = 2
e = 4
w = 8
u = 16
d = 32
'
DIM SHARED twopow(100)
twopow(n) = 1
twopow(s) = 2
twopow(e) = 4
twopow(w) = 8
twopow(u) = 16
twopow(d) = 32
'
location = 1
grandroom = 2
vestibule = 3
narrow1 = 4
lakeshore = 5
island = 6
brink = 7
iceroom = 8
ogreroom = 9
narrow2 = 10
pit = 11
crystal = 12
batscave = 13
steam = 14
deadend = 15
ladder = 16
maze = 17
flames = 18
'
m1 = 1
m2 = 2
m3 = 3
m4 = 4
m5 = 5
m6 = 6
m7 = 7
m8 = 8
m9 = 9
m10 = 10
m11 = 11
m12 = 12
m0dh = 1 + 12
m14 = 14
m15 = 15
m16 = 16
m17 = 17
m18 = 18
m19 = 19
'
x = start
mazeloc = 0
'
turns = 0
REM type
DIM SHARED room$(18), room(18), visited(18), ogreloc(18), thelocation(18)
FOR x = 1 TO 18
READ room$(x)
visited(x) = false
ogreloc(x) = false
thelocation(x) = false
NEXT x
DATA Start, Grandroom, Vestibule, Narrow1
DATA Lakeshore, Island, Brink, Iceroom
DATA Ogreroom, Narrow2, Pit, Crystal
DATA Batscave, Steam, Deadend, Ladder
DATA Maze, Flames
'
dchar$ = "NSEWUD"
cmnd$ = ""
turns = 0
done = false
quit = false
eaten = false
awake = false
readmsg = false
carrying = false
dropped = false
trapped = false
cooked = false
sameplace = false
'
REM start
GOSUB introduction
DO
IF NOT sameplace THEN
GOSUB wipe
END IF
sameplace = false
visited(location) = true
PRINT
PRINT room$(location)
PRINT
SELECT CASE location
CASE 1
GOSUB pstart
CASE 2
GOSUB pgrandroom
CASE 3
GOSUB pvestibule
CASE 4
GOSUB pnarrow1
CASE 5
GOSUB plakeshore
CASE 6
GOSUB pisland
CASE 7
GOSUB pbrink
CASE 8
GOSUB piceroom
CASE 9
GOSUB pogreroom
CASE 10
GOSUB pnarrow2
CASE 11
GOSUB ppit
CASE 12
GOSUB pcrystal
CASE 13
GOSUB pbatscave
CASE 14
GOSUB psteam
CASE 15
GOSUB pdeadend
CASE 16
GOSUB pladder
CASE 17
GOSUB pmaze
CASE 18
GOSUB pflames
CASE ELSE
PRINT "There is no such location!"
END SELECT
LOOP UNTIL quit OR done
GOSUB congradulations
END
wipe:
CLS
RETURN
introduction:
GOSUB wipe
PRINT
PRINT "Welcome to a mini-adventure!"
PRINT
PRINT "Your goal will to be to find a treasure"
PRINT "and bring it to the starting point."
PRINT
PRINT "You will also get points for finding"
PRINT "each location in the adventure."
PRINT
PRINT "Points will be deducted for various"
PRINT "undesirable happenings: waking the"
PRINT "ogre, getting eaten, getting toasted,"
PRINT "etc."
PRINT
PRINT "I will guide you and be your eyes and"
PRINT "ears. I will describe your location"
PRINT "and give you special instructions"
PRINT "from time to time."
PRINT
INPUT "Press return to continue:", a$
GOSUB wipe
PRINT
PRINT "Instructions continued:"
PRINT
PRINT "To command me, tell me a direction"
PRINT "to take - (N)orth, (S)outh, (E)ast,"
PRINT "(W)est, (U)p, or (D)own."
PRINT
PRINT "Note: I only look at the first letter"
PRINT "of the command so abbreviations"
PRINT "are acceptable."
PRINT
PRINT " When you are ready to begin your"
PRINT "adventure, just press the 'return' key."
INPUT " ", a$
GOSUB wipe
RETURN
congradulations:
IF NOT cooked THEN
IF NOT quit THEN
PRINT "Congradulations!"
PRINT
PRINT "You got the treasure in "; turns; " turns."
END IF
IF awake THEN
PRINT "You woke the ogre!"
END IF
PRINT
PRINT "You scored "; score; " points out"
PRINT "of a maximum of 200 points."
PRINT "So long for now, come again soon!"
ELSE
PRINT "Sorry, try again soon!"
PRINT "You have reached the end of the game."
END IF
PRINT
INPUT "Press enter to leave the game: ", a$
GOSUB wipe
RETURN
noway:
PRINT
PRINT "You can not go in that direction."
RETURN
ogreaction:
IF NOT awake THEN
PRINT "This is the ogre's lair!"
PRINT "If you are not careful you will"
PRINT "wake him."
IF (turns MOD 7) = 0 THEN
awake = true
PRINT "Now you have done it!"
PRINT "You woke the ogre - better"
PRINT "get out of here while you can."
END IF
ELSE
PRINT "You would not listen to me would"
PRINT "you? You really better get out"
PRINT "of here before you get eaten!"
IF carrying THEN
IF (turns MOD 2) = 0 THEN
PRINT "Too bad!! The ogre caught you"
PRINT "and roasted you for dinner."
PRINT "Better luck next time!!"
eaten = true
quit = true
ELSE
PRINT "Get out fast if you do not want"
PRINT "to be a supper for the ogre!!"
END IF
ELSE
IF (turns MOD 5) = 0 THEN
PRINT "too bad - you have been eaten!"
eaten = true
quit = true
END IF
END IF
END IF
RETURN
pstart:
IF carrying THEN
done = true
ELSE
PRINT "You are standing by a big hole in"
PRINT "the ground, It looks big enough"
PRINT "to climb down."
SELECT CASE whichway
CASE 1, 2, 4, 8
GOSUB noway
CASE 16
PRINT "You can not jump into the clouds!"
CASE 32
location = vestibule
END SELECT
END IF
RETURN
pvestibule:
PRINT "You are in the entrance to a cave"
PRINT "of passageways. There are halls"
PRINT "leading off to the north, south,"
PRINT "and east. Above you is a tunnel"
PRINT "leading to the surface."
IF dropped THEN
PRINT "to the north though a narrow crack,"
PRINT "You can see the treasure. If you"
PRINT "stretch your arm through you might"
PRINT "reach it. Do you want to try?"
INPUT cmnd$
IF UCASE$(cmnd$) = "Y" THEN
carrying = true
dropped = false
END IF
END IF
SELECT CASE whichway
CASE 1
location = narrow1
CASE 2
location = grandroom
CASE 4
location = iceroom
CASE 8, 32
GOSUB noway
CASE 16
location = start
END SELECT
RETURN
pgrandroom:
PRINT "You are in a huge open room, with"
PRINT "an immense expanse of ceiling."
PRINT "A dark passage leads west and a"
PRINT "narrow crawl leads downward."
SELECT CASE whichway
CASE 8
location = brink
CASE 32
location = iceroom
CASE 1, 2, 4, 16
GOSUB noway
END SELECT
RETURN
pnarrow1:
PRINT "You are in a narrow passage which"
PRINT "continues to the north, It is"
PRINT "extremely narrow to the south."
PRINT "A tight crawl also leads to the east"
PRINT "A curious odor seeps through it."
PRINT "I would think twice before trying"
PRINT "to go that way."
IF carrying THEN
PRINT "The treasure will not fit through"
PRINT "The crack going south. Do you want"
PRINT "to leave it here?"
INPUT cmnd$
IF UCASE$(LEFT$(cmnd$, 1)) = "Y" THEN
dropped = true
carrying = false
END IF
END IF
SELECT CASE whichway
CASE 1
location = lakeshore
CASE 4
location = ogreroom
CASE 2
PRINT "It is too narrow to get through."
CASE 8, 16, 32
GOSUB noway
END SELECT
RETURN
plakeshore:
PRINT "You are on the shore of a vast"
PRINT "underground lake. Narrow passages"
PRINT "wind away to the east and south."
PRINT "A small island is visible in the"
PRINT "center of the lake to the north."
SELECT CASE whichway
CASE 1
location = island
CASE 2
location = narrow1
CASE 4
location = narrow2
CASE 8, 16, 32
GOSUB noway
END SELECT
RETURN
pisland:
PRINT "You are on a small island in the"
PRINT "center of the huge underground lake."
PRINT "Dark frigid waters surround you on"
PRINT "all sides. You can barely make out"
PRINT "the shoreline to the south."
PRINT "A small message is scratched in the"
PRINT "dirt here. It say: 'The treasure"
PRINT "may be found in the maze.'"
SELECT CASE whichway
CASE 1, 4, 8, 16, 32
GOSUB noway
CASE 2
location = lakeshore
END SELECT
readmsg = true
RETURN
pbrink:
PRINT "You are on the brink of a steep"
PRINT "incline. The bottom of the pit"
PRINT "is over fifty feet below you."
PRINT "You probably could slide down"
PRINT "safely, but I will not promise you"
PRINT "that you could get back up."
PRINT "To the west is a dark opening"
PRINT "into a rubble-filled tunnel. A"
PRINT "vampire bat just flew out of it"
PRINT "shrieking."
SELECT CASE whichway
CASE 1, 2, 4, 16
GOSUB noway
CASE 8
location = ogreroom
CASE 32
location = pit
END SELECT
RETURN
piceroom:
PRINT "You are in a room whose walls are"
PRINT "formed from a deep blue crystalline"
PRINT "ice. To the north a narrow tunnel"
PRINT "an omnious growling sound may be"
PRINT "heard. To the east a sparkling"
PRINT "luminescence emanates from a broad"
PRINT "opening. To the west a passage"
PRINT "leads back to the vestibule."
SELECT CASE whichway
CASE 4
location = crystal
CASE 1
location = ogreroom
CASE 8
location = vestibule
CASE 2, 16, 32
GOSUB noway
END SELECT
RETURN
generaltalk:
PRINT "You are in a low room whose walls"
PRINT "are covered with ominus dark"
PRINT "gouts of dried blood. The center"
PRINT "of the room is dominated by a"
PRINT "firepit, which contains burned"
PRINT "out coals and a long spit suspended"
PRINT "over it's center."
PRINT "From one dark corner emanates a"
PRINT "horrible growling noise like that"
PRINT "of some unspeakable monster snoring"
PRINT "during it's dream of rending you limb"
PRINT "from limb and making you it's dinner!"
RETURN
pogreroom:
GOSUB generaltalk
GOSUB ogreaction
IF NOT eaten THEN
PRINT "There are exits to the east, west,"
PRINT "north, and to the south."
SELECT CASE whichway
CASE 1
location = narrow2
CASE 2
location = iceroom
CASE 4
location = batscave
CASE 8
location = narrow1
CASE 16
GOSUB noway
CASE 32
quit = true
eaten = true
PRINT "Oh no!!! You dummy!!!"
PRINT "You just fell in the firepit"
PRINT "and made such a ruckus that"
PRINT "you woke the ogre. I hate to"
PRINT "tell you this, but you are"
PRINT "also trapped!"
FOR i = 1 TO 5
FOR j = 1 TO 100
PRINT ".";
NEXT j
NEXT i
PRINT
PRINT "you have been added to the"
PRINT "ogre's gourmet recipe library!"
PRINT "Better luck next time."
END SELECT
END IF
RETURN
psameplace:
PRINT "You have crawled around some"
PRINT "twisted tunnels and wound up"
PRINT "where you began."
sameplace = true
RETURN
treasure:
IF NOT carrying THEN
IF readmsg THEN
PRINT "The treasure is here!!"
PRINT "Do you want to take it now?"
INPUT cmnd$
IF UCASE$(LEFT$(cmnd$, 1)) = "Y" THEN
carrying = true
dropped = false
END IF
ELSE
PRINT "The light is extrmely dim here"
PRINT "You better get out or risk"
PRINT "falling into the pit."
END IF
END IF
RETURN
pmaze:
mazeloc = m1
DO UNTIL mazeloc = 0
IF NOT sameplace THEN
GOSUB wipe
END IF
sameplace = false
PRINT
SELECT CASE mazeloc
CASE 1
GOSUB pm1
CASE 2
GOSUB pm2
CASE 3
GOSUB pm3
CASE 4
GOSUB pm4
CASE 5
GOSUB pm5
CASE 6
GOSUB pm6
CASE 7
GOSUB pm7
CASE 8
GOSUB pm8
CASE 9
GOSUB pm9
CASE 10
GOSUB pm10
CASE 11
GOSUB pm11
CASE 12
GOSUB pm12
CASE 13
GOSUB pm0dh
CASE 14
GOSUB pm14
CASE 15
GOSUB pm15
CASE 16
GOSUB pm16
CASE 17
GOSUB pm17
CASE 18
GOSUB pm18
CASE 19
GOSUB pm19
END SELECT
LOOP
RETURN
pm1:
PRINT "You are in a maze of featureless"
PRINT "passages. From here you can go south,"
PRINT "east, west, or up."
SELECT CASE whichway
CASE 2
location = ladder
mazeloc = 0
CASE 4
mazeloc = m2
CASE 8
mazeloc = m4
CASE 16
location = steam
mazeloc = 0
CASE 1, 32
GOSUB noway
END SELECT
RETURN
pm2:
CALL describe(nw)
SELECT CASE whichway
CASE 1
mazeloc = m1
CASE 8
GOSUB psameplace
CASE 2, 4, 16, 32
GOSUB noway
END SELECT
RETURN
pm3:
CALL describe(ne)
SELECT CASE whichway
CASE 1
mazeloc = m1
CASE 4
GOSUB psameplace
CASE 2, 8, 16, 32
GOSUB noway
END SELECT
RETURN
pm4:
CALL describe(sew)
SELECT CASE whichway
CASE 2
mazeloc = m7
CASE 4
mazeloc = m3
CASE 8
mazeloc = m5
CASE 1, 16, 32
GOSUB noway
END SELECT
RETURN
pm5:
CALL describe(nonly)
SELECT CASE whichway
CASE 1
mazeloc = m1
CASE 2, 4, 8, 16, 32
GOSUB noway
END SELECT
RETURN
pm6:
CALL describe(ne)
SELECT CASE whichway
CASE 1
mazeloc = m4
CASE 4
GOSUB psameplace
CASE 2, 8, 16, 32
GOSUB noway
END SELECT
RETURN
pm7:
CALL describe(nsew)
SELECT CASE whichway
CASE 1
mazeloc = m5
CASE 2
mazeloc = m9
CASE 4
mazeloc = m6
CASE 8
mazeloc = m8
CASE 16, 32
GOSUB noway
END SELECT
RETURN
pm8:
CALL describe(nw)
SELECT CASE whichway
CASE 1
mazeloc = m5
CASE 8
GOSUB psameplace
CASE 2, 4, 16, 32
GOSUB noway
END SELECT
RETURN
pm9:
CALL describe(sw)
SELECT CASE whichway
CASE 2
mazeloc = m11
CASE 8
mazeloc = m10
CASE 1, 4, 16, 32
GOSUB noway
END SELECT
RETURN
pm10:
CALL describe(ns)
SELECT CASE whichway
CASE 1
mazeloc = m8
CASE 2
GOSUB psameplace
CASE 4, 8, 16, 32
GOSUB noway
END SELECT
RETURN
pm11:
CALL describe(newud)
SELECT CASE whichway
CASE 1
mazeloc = m9
CASE 2
GOSUB noway
CASE 4
mazeloc = m6
CASE 8
mazeloc = m10
CASE 16
mazeloc = m1
CASE 32
mazeloc = m12
END SELECT
RETURN
pm12:
CALL describe(dn)
SELECT CASE whichway
CASE 1
mazeloc = m0dh
CASE 32
mazeloc = m16
CASE 2, 4, 8, 16
GOSUB noway
END SELECT
RETURN
pm0dh:
CALL describe(dn)
SELECT CASE whichway
CASE 1
mazeloc = 14
CASE 32
mazeloc = m17
CASE 2, 4, 8, 16
GOSUB noway
END SELECT
RETURN
pm14:
CALL describe(dn)
SELECT CASE whichway
CASE 1
mazeloc = m15
CASE 32
mazeloc = m18
CASE 2, 4, 8, 16
GOSUB noway
END SELECT
RETURN
pm15:
CALL describe(ud)
SELECT CASE whichway
CASE 16
mazeloc = m1
CASE 32
mazeloc = m19
CASE 1, 2, 4, 8
GOSUB noway
END SELECT
RETURN
pm16:
CALL describe(ns)
SELECT CASE whichway
CASE 1
mazeloc = m17
CASE 2
GOSUB psameplace
CASE 4, 8, 16, 32
END SELECT
RETURN
pm17:
CALL describe(ns)
SELECT CASE whichway
CASE 1
mazeloc = m18
CASE 2
mazeloc = m16
CASE 4, 8, 16, 32
GOSUB noway
END SELECT
RETURN
pm18:
CALL describe(ns)
SELECT CASE whichway
CASE 1
mazeloc = m19
CASE 2
mazeloc = m17
CASE 4, 8, 16, 32
GOSUB noway
END SELECT
RETURN
pm19:
CALL describe(su)
GOSUB treasure
SELECT CASE whichway
CASE 2
mazeloc = m18
CASE 16
mazeloc = m15
CASE 1, 4, 8, 32
GOSUB noway
END SELECT
RETURN
pnarrow2:
PRINT "You are in a narrow passage."
PRINT "To the west the passage opens out"
PRINT "by a lake shore. To the east it is"
PRINT "even tighter. You just might be"
PRINT "able to squeeze through if you try"
PRINT "real hard."
PRINT "There is also a strange looking"
PRINT "alcove in the south wall that seems"
PRINT "to open into a very cark tunnel."
SELECT CASE whichway
CASE 8
location = lakeshore
CASE 4
location = steam
CASE 2
location = ogreroom
CASE 1, 16, 32
GOSUB noway
END SELECT
RETURN
ppit:
PRINT "You are the bottom of a fifty"
PRINT "foot pit. The walls are just a"
PRINT "hair too steep too climb. The pit"
PRINT "is empty exept for a few old"
PRINT "dried bones - I can not tell if they"
PRINT "are human or not!! In the center"
PRINT "of the pit is a narrow shinny"
PRINT "leading downward."
SELECT CASE whichway
CASE 32
location = ladder
CASE 16
PRINT "If you climb that,"
PRINT "you are sure to kill yourself!"
CASE 1, 2, 4, 8
GOSUB noway
END SELECT
RETURN
pcrystal:
PRINT "You are in the shining hall of crystal."
PRINT "It is intensely cold, but also chillingly"
PRINT "beautiful. There are large glass"
PRINT "formations rising from the floor"
PRINT "as if they had grown there, yet"
PRINT "delicately sculptured with multi-faceted"
PRINT "radiant sides. An intense white"
PRINT "light shines brilliantly from the"
PRINT "floor, which is also made of a"
PRINT "mirror smooth lead crytal. The light"
PRINT "is almost blinding and the many"
PRINT "reflections that it sets off amomg"
PRINT "the crystal formations of the room"
PRINT "make it almost impossible to tell"
PRINT "where the room begins and where"
PRINT "it ends."
SELECT CASE whichway
CASE 4
location = maze
CASE 1, 8
location = ogreroom
CASE 2, 16, 32
GOSUB noway
END SELECT
RETURN
pbatscave:
PRINT "You are in a steep cavern filled"
PRINT "with shrieking vampire bats. They"
PRINT "swoop and dive at you by the"
PRINT "thousands. If I were you, I would"
PRINT "get out as quick as i could. There"
PRINT "are openings to the west and north."
SELECT CASE whichway
CASE 8
location = ogreroom
CASE 1
location = steam
CASE 2, 4, 16, 32
GOSUB noway
END SELECT
RETURN
psteam:
PRINT "You have entered a hall filled with"
PRINT "a stifling steamy vapor. There are"
PRINT "innumerable small geysers scattered"
PRINT "about, each contributing it's own steam"
PRINT "to the general mist."
PRINT "To the west is a dark opening, as"
PRINT "well as to the north. Further out"
PRINT "in the middle of the room is a dark"
PRINT "opening in the floor into which some"
PRINT "of the vapor seems to be seeping."
SELECT CASE whichway
CASE 8
location = narrow2
CASE 1
location = deadend
CASE 32
location = maze
CASE 2
location = batscave
CASE 4, 16
GOSUB noway
END SELECT
RETURN
pladder:
PRINT "You are at the base of a huge ladder"
PRINT "reaching up out of sight. It must"
PRINT "extend up at least 500 feet, and it will"
PRINT "tale someone brave in heart to scale"
PRINT "it. There also passages which"
PRINT "lead north and down."
SELECT CASE whichway
CASE 1
location = maze
CASE 32
location = flames
CASE 16
IF carrying THEN
PRINT "You can not carry the treasure up the"
PRINT "ladder - it is too heavy!"
ELSE
location = vestibule
END IF
CASE 2, 4, 8
GOSUB noway
END SELECT
RETURN
pflames:
PRINT "Unfortunately you have fallen into"
PRINT "an underground pit. It is the"
PRINT "source of heat that produces"
PRINT "the geysers in the steam room. You"
PRINT "have been toasted to a crisp to put"
PRINT "it politely."
cooked = true
done = true
RETURN
pdeadend:
PRINT "Dead end."
PRINT "You might come back the way"
PRINT "from whence you came."
SELECT CASE whichway
CASE 2
location = steam
CASE 1, 4, 8, 16, 32
GOSUB noway
END SELECT
RETURN

FUNCTION bittest (a, b)
IF ((FIX(a / twopow(b))) MOD 2) = 1 THEN
bivalt = true
ELSE
bivalt = false
END IF
bittest = bivalt
END FUNCTION

SUB describe (dir) STATIC
PRINT "You are in a maze of featureless"
PRINT "passages. There are exits visible"
PRINT "in the following directions:"
IF bittest(dir, n) = true THEN
PRINT "N ";
END IF
IF bittest(dir, s) = true THEN
PRINT "S ";
END IF
IF bittest(dir, e) = true THEN
PRINT "E ";
END IF
IF bittest(dir, w) = true THEN
PRINT "W ";
END IF
IF bittest(dir, u) = true THEN
PRINT "U ";
END IF
IF bittest(dir, d) = true THEN
PRINT "D ";
END IF
PRINT
END SUB

FUNCTION score
sc = 0
FOR atloc = start TO flames
IF visited(atloc) = true THEN
sc = sc + 10
END IF
NEXT atloc
IF NOT quit THEN
sc = sc + 30
END IF
IF cooked THEN
sc = sc - 50
END IF
IF eaten THEN
sc = sc - 50
END IF
IF awake THEN
sc = sc - 25
END IF
score = sc
END FUNCTION

FUNCTION whichway STATIC
turns = turns + 1
ch$ = ""
cmnd$ = ""
DO
DO
PRINT
INPUT "Which way: ", cmnd$
LOOP UNTIL LEN(cmnd$) > 0
ch$ = UCASE$(LEFT$(cmnd$, 1))
SELECT CASE ch$
CASE "N"
wway = n
CASE "S"
wway = s
CASE "E"
wway = e
CASE "W"
wway = w
CASE "U"
wway = u
CASE "D"
wway = d
CASE "Q"
quit = true
EXIT FUNCTION
END SELECT
LOOP UNTIL INSTR(dchar$, ch$) > 0
PRINT
whichway! = wway
END FUNCTION

[=========== code ends before this line =================]

Older Posts »

Categories