r/Basic • • Mar 21 '22

Wordle in BASIC, from 1973!

11 Upvotes

Proving that there is nothing new under the sun, here is an implementation of a Wordle-like game from 1973!


r/Basic • • Aug 27 '20

Another one. What would the black dot on line 40 be? Any help is appreciated. Using Chipmunk Basic.

Post image
11 Upvotes

r/Basic • • Feb 21 '20

PureBasic, a powerful compiled BASIC-like language & IDE

Thumbnail purebasic.com
11 Upvotes

r/Basic • • Jun 27 '26

FOSS dev builds a BASIC compiler using LLVM

Thumbnail theregister.com
10 Upvotes

I wrote this. I thought you might like it... And indeed the project itself!


r/Basic • • Aug 21 '22

BASIC and support for "metaprogramming"

10 Upvotes

Here's a a ridiculous example of something we can do in BASIC Anywhere Machine, and I wonder if this is something unique to BASIC Anywhere Machine or if it is something that can be done in any other BASIC dialects:

BASIC Anywhere Machine's interpreter currently knows nothing about PI.

In a "traditional" approach, we could define a constant for PI and use that constant throughout the program.

Here, I've instead embedded some TiddlyWiki syntax in the BASIC program, which TiddlyWiki processes (preprocessing phase?) just before passing the BASIC program to the interpreter.

During pre-processing, every occurence of <<pi>> will get replace by the literal value assigned to "pi" via the TiddlyWiki "$let" widget.

(In the image above, We see how the source gets manipulated by TiddlyWiki.)

I'm thinking this is pretty cool, kind of injecting an interesting twist to an old programming language. (Well, I'm not sure about the "readability" of the program for we human folk.)

I'm trying to cobble together some documentation for this. If you know of any good online references where I can find the right "lingo" for what I've shown here, please let me know.

Cheers !


r/Basic • • Jun 13 '22

Code Golf now supports FreeBASIC!

Thumbnail
code.golf
10 Upvotes

r/Basic • • Mar 14 '22

Birth of BASIC

Thumbnail
youtube.com
10 Upvotes

r/Basic • • Feb 25 '21

I’m a beginner programmer who came across my dad’s old BASIC textbook. Here’s a short video I made about some problem solving techniques I liked.

Thumbnail
youtu.be
10 Upvotes

r/Basic • • Feb 14 '21

Simple Introduction to BASIC Programming

10 Upvotes

Hi. I just released a 30 minute video introduction to BASIC programming and thought I'd share it here. If it's against the rules, please delete. Hope someone finds it helpful: https://www.youtube.com/watch?v=CpJf_6nWqLk


r/Basic • • Jul 01 '20

Color Maximite 2 - ARM CPU that runs BASIC!

Thumbnail
youtube.com
10 Upvotes

r/Basic • • Jan 01 '19

New Hampshire to commemorate BASIC with historical marker at Dartmouth

Thumbnail
granitegeek.concordmonitor.com
10 Upvotes

r/Basic • • 9d ago

DDGBasic: a BASIC dialect where SQLite is built in, so SQL statements are just statements

9 Upvotes

I’ve been working on a small BASIC interpreter for a while under the name DBBasic. I’ve just renamed it DDGBasic. The idea behind it is that SQL shouldn’t need a driver, a connection object, or a string-building layer. SQLite is part of the language, and host variables bind with :name

No cursor handling, no ? placeholders, and no string concatenation to build queries. Variables bind safely, so injection isn’t a concern for values.

Other things it has:

  • Data-centric from the start: LOAD for CSV/JSONL/Parquet with TRANSFORM and VALIDATE clauses, and FETCH for HTTP (GET/POST/PUT/PATCH/DELETE)

  • DuckDB support alongside SQLite, for analytical queries

  • User-defined functions with proper shadow scoping, and DIM for locals

  • String interpolation with ${} in backtick strings

  • Higher-order functions: MAP, FILTER, REDUCE, SORT WITH

  • 0-based arrays, + for numbers and & for string concatenation (no more accidental "1"+"2")

Why BASIC? Partly nostalgia. Mostly because BASIC’s “type it and it runs” feel is a good fit for quick data wrangling: loading a file, poking at it with SQL, and writing the result out. For that kind of one-off work it’s less ceremony than a Python script with sqlite3 and pandas.

Install: pip install ddgbasic

Site: https://github.com/ddgflorida/DDGBasic

basic

database engine sqlite 
REM Supports DuckDB also
create table t (n integer);

for i = 1 to 10
  insert into t values (:i);
next

for row in (select n, n*n as sq from t where n % 2 = 0)
  print row.n, row.sq
next

r/Basic • • 17d ago

pBasic for macOS • a modern Basic with a Retro vibe

Thumbnail
gallery
9 Upvotes

pBasic for macOS is a modern BASIC interpreter with a retro vibe. It allows you to easily find your way into computer programming and form a connection with the code. You will learn about Games programming, how to animate Sprites, and compose your own Functions. pBasic gives you a blank canvas in which you can realize your own creations.

pBasic provides a friendly BASIC coding experience in an environment which makes it easy to write and run code. You type commands like CIRCLE or PRINT, and the app draws shapes and text on the screen in real time. Using features like Sprite animation, it is easy to write simple games, and numerous examples are provided with the included Demos. https://apps.apple.com/ca/app/pbasic/id6789459761?mt=12


r/Basic • • Aug 10 '26

Cool Chess: a full-featured chess engine and graphical UI in BASIC

Post image
9 Upvotes

r/Basic • • Jun 03 '26

Pi Shack BASIC works with Apache logs and reveals something amusing

Post image
9 Upvotes

Pi Shack BASIC (psBASIC) has a DELIMIT command which allows you to set the field splitting parameters for incoming lines of text. From the early days BASIC was geared toward the Comma Separated Value (CSV) format. It simply makes sense when doing double duty for user facing input and stored data. I won't digress.

The point is that parsing Apache and by extension other web servers' access logs normally requires some tedious code. But in psBASIC the issue is easily solved like this:

DELIMIT #1," ""\"
OPEN "i",#1,"access.log-20260602"
INPUT #1,ip$,site$,auth$,tstamp$,tzone$,request$,code%,sz%,refer$,ua$

The DELIMIT command takes a string of 4 bytes (ASCII characters):

  1. Separator - in this case a space " "

  2. enclosure - in this case a double quote " (quotes in psBASIC are escaped by doubling them, as with M$)

  3. enclosure escape - in this case the backslash "\" (which has no special meaning to psBASIC)

  4. and whether to treat consecutive separators as one - in this case the value is not provided so the default of "no" is used.

This defines the file as space separated, fields are optionally enclosed with quotes and a quote within a field is escaped by backslash.

There are two aspects of the traditional Apache log that aren't covered: dash being the empty value and square brackets around the time stamp and zone. Those two issues are minor and psBASIC has already done the lion share of the log line splitting.

The thing that brought this topic up today was a wave of about 100x the normal traffic hitting my server the past couple of days. I wanted to know: man or machine? My normal tools indicated the traffic was most likely machine. So what were they after. A quick peek showed a lot of PHP requests... I don't run PHP!

Being off the beaten path can some times give a better vantage point than others have. So I immediately deployed psBASIC to track down all of the IP addresses looking for PHP pages. On my server these are indisputable hacking attempts, because I have no PHP. 😃 So I want to gather all those addresses and block them FOREVER!! 🔥

My script was pretty simple:

  1. read the log.

  2. Look for ".php" only at the end of the requested file, ignoring the request method, protocol version and any query arguments ("?..." part of the URL).

  3. Also look for file requests that the file name part starts with ".env", since I don't use those either, so they are also hacking attempts.

  4. And look for requests that don't specify a user agent string, because the sender is obviously hiding something.

  5. Collect the IP addresses, count their hits and sort them in descending order by hits.

UNIX is an environment about plugging the best suited things together to make a solution. psBASIC leverages this by allowing the programmer to open unidirectional or bidirectional pipes to other programs. So step 5 was mostly accomplished by AWK and "sort" while psBASIC parsed Apache logs, filtered and extracted the addresses. This was done like this:

OPEN "o",#2,"|awk '{ l[$1]++ } END { for(i in l) print l[i] ""\t"" i }' | sort -rn > summary.lst"
' ...
PRINT #2,ip$

The first line opens AWK & sort for writing, providing the AWK program to summarize hits and instructing sort to sort it in reverse numerical order. Yes, I could have written that in psBASIC code. But it was much more quick, simple and concise to do it this way. The sorted list with the worst offenders is at the head of the "summary.lst" file. I still have a hard time letting myself escape the 8.3 file naming convention. 😄

And for added fun I dumped the top ten offenders to the screen when done. See the screen shot above. This immediately piqued my curiosity, and this is where the fun begins, and reveals the "amusing" bit:

I've often stated that the worst security threat to us, as individual computer users, is "gig-a-buck tech". And this sure provided some evidence to that affect. I'm not going to attempt to fully unpack that statement. But this is what I found. All but 1 of the top 12 attacking computers, with more than 10 hack attempts on this day, was Micro$oft owned:

838    20.220.148.33    <- msft
568    4.193.112.29     <- msft
477    20.151.12.206    <- msft
333    20.104.227.76    <- msft
324    20.104.24.206    <- msft
274    20.226.123.158   <- msft
222    20.220.185.243   <- msft
220    52.138.23.40     <- msft
192    20.9.87.130      <- msft
110    20.226.41.15     <- msft
30     192.109.200.215  <- Germany
29     52.173.238.41    <- msft
8      198.186.130.38

I determined that by another psBASIC program that connects to Cymru's "whois" database to identify the network. psBASIC also has socket support.

Cymru provides records like:

8075    | 20.220.148.33    | 20.192.0.0/10       | US | arin     | 2017-10-18 | MICROSOFT-CORP-MSN-AS-BLOCK - Microsoft Corporation, US

That is really only half the story as most cyber-thugs rent more than one server/instance. I'm sure when I finish globbing addresses by owned networks I'll also have amazon and g00gle nets in my black list. They regularly show up. I figure I will eventually find and block all the gig-a-buck tech data centers... and then maybe i can breath a sigh of relief.

I have more information about working with Apache logs on my blog as well as other language demos.


r/Basic • • Feb 18 '23

Loads of BASIC books at the internet archive

9 Upvotes

I'm setting up some grouped lists of them as a bibliography in the BASIC Anywhere Machine User Guide and Programming Reference.

You can access a ton of books via this link: The Internet Archive.

My groupings:


r/Basic • • Oct 15 '22

Simple calculator by me

Post image
9 Upvotes

r/Basic • • Sep 23 '22

Microsoft BASIC from 1977 on my 6502 computer!

Thumbnail
youtu.be
9 Upvotes

r/Basic • • Sep 02 '22

What was Coding like 40 years ago?

Thumbnail
youtube.com
9 Upvotes

r/Basic • • Aug 17 '21

Thought id share TinyBaisc

9 Upvotes

hey everyone,

in 1976, a man named Tom Pittman make a $5 BASIC interpreter for small storage computers. It does not compare to somthing like BBC Basic, QBasic, or GW-Basic, but has most of the basic commands. he released the sourcecode rewritten from assembly, into C to run on modern hardware. you can go here to read more about it, get manuals, and find the C source code. to build it in linux (make sure gcc is installed) to make it an executible, do the following from a terminal:

gcc -Wall -g -c TinyBasic.c

Then a TinyBasic.o file will be created.

in the same directory, do the following:

gcc -o tinybasic TinyBasic.o -lm

you will be left with a tinybasic file that can be executed.

to start the interpreter do:

./tinybasic

then a : prompt will appear. You have started tinybasic and are ready to code! enjoy!


r/Basic • • Dec 04 '20

EndBASIC - A modern interpreter with a retro feeling, written in Rust

Thumbnail endbasic.jmmv.dev
9 Upvotes

r/Basic • • Sep 04 '20

Cowbduction - Game made with PureBasic - with source

Thumbnail
ricardo-sdl.itch.io
9 Upvotes

r/Basic • • Jun 08 '20

Understanding Lunar LEM Rocket from Ahl's "BASIC Computer Games"

9 Upvotes

Hello, I'm hoping this is a good place to ask this question because:

  1. I'm not a rocket scientist or math whiz

  2. I'm stumped on this code!

I'm analyzing the "Lunar LEM Rocket" code from David Ahl's book "BASIC Computer Games". I like to do that because BASIC is fairly easy to get the gist of, and usually the programs aren't hard to figure out. I'm trying to learn some game programming!

The code I'm talking about is available here: https://www.atariarchives.org/basicgames/showpage.php?page=106

and here: http://www.moorecad.com/classicbasic/basic/creative/lunar.bas

I don't know if this is the place to get into an in-depth review of what I've figured out so far, but at the end of the day, here are my questions:

420 Q=S*K/M: J=V+G*S+Z*(-Q-Q*Q/2-Q^3/3-Q^4/4-Q^5/5)
430 I=A-G*S*S/2-V*S+Z*S*(Q/2+Q^2/6+Q^3/12+Q^4/20+Q^5/30):RETURN

Assuming:

  • S is a time interval, set to 10 seconds initially

  • K is the "burn rate" of fuel that the user has input. 0 means no burn, just fall...

  • M is the mass of the capsule, set to 33,000

  • V is, I think, the velocity in miles/sec. It's initialized to 1.

  • G is the gravity constant, for the Moon, set to 0.001 (miles/sec2)

  • Z is, I think, the thrust effect, set to 1.8.

  • A is Altitude

Just from analysis, I think J represents the velocity (as V gets set to J later on...) and I represents how far we've descended (A gets set to I later on)... but what formulas are these?

There are more formulas that I don't recognize.

350 D=V+SQR(V*V+2*A*(G-Z*K/M)):S=2*A/D
...
370 W=(1-M*G/(Z*K))/2: S=M*V/(Z*K*(W+SQR(W*W+V/Z)))+.05

I'm sure that this all would be clearer to me if I remembered my HS physics, or was smarter than I like to think I am... but even if you just point me at a website that could help fill in the gaps, I would be grateful!

Thank you!


r/Basic • • May 22 '20

Microsoft Basic 7.1

9 Upvotes

anyone know where I can safely download it? I use to own the floppies for it, but my computer no longer has a floppy anyway. I'd like to use it with dosbox.


r/Basic • • Feb 17 '20

books to learn game programming

9 Upvotes

hello guys. can you guys suggest some (pdf) books to learn game programming with gwbasic ?

just for hobby, mid-life crisis.

gwbasic was my first exposure to coding. coding for money not so fun anymore now.

so I need to create something on my free time.