Questions tagged [forth]
Forth is a stack-based programming language originally developed in the 1970s by Charles H. Moore for controlling radiotelescopes.
9
questions
4
votes
1
answer
163
views
Bubble Sort in Forth (for strings)
I wrote the following Forth code for sorting a string with the Bubble Sort method.
It looks nice to my eyes, but I'd like your experienced opinion and any comments about the code you might have.
In ...
3
votes
2
answers
64
views
Project Euler 8: find the maximum product of 13 consecutive digits
I'm doing Project Euler problems as a learning platform for Forth. Currently I'm solving Project Euler Problem 8 which involves a 1000-long string, which I entered directly in the source code.
My ...
7
votes
2
answers
512
views
A simple clock in FORTH
I try to program a stopwatch/countdown clock in FORTH with Gforth (and using Gforth-specific words).
I'm a complete beginner and the following code is the basic stuff (going to add an alarm function ...
6
votes
2
answers
561
views
Simple terminal graphics line drawing
The program starts at the center of the screen and starts drawing a line in 50ms steps. When the line hits the edge of the terminal it will be reflected and continue drawing. ...
2
votes
0
answers
43
views
Forth to the past - mergesort preps
Still oiling my Forth. Below are few essential algorithms for in-place merge. Please review.
Some introductory comments:
>swap< is not a cute smiley. I am ...
6
votes
1
answer
240
views
Forth to the past - qsort
To make a long story short, I must revive my Forth. It is rusty; last time I did anything serious in Forth was 30 years ago (man, I am old). As an exercise, I translated an STL-like implementation of <...
16
votes
3
answers
2k
views
Reverse Polish notation based compiler
Description
Very small subset of Forth
This is a proof of concept level compiler, no optimizations or over/underflow checking
See the embedded POD for more information
NASM is used as assembler
gcc ...
25
votes
2
answers
1k
views
FizzBuzz in Forth
There are quite a large number of existing implementatons of FizzBuzz but I awoke this morning in a cold sweat with the terrible revelation that Code Review had no FizzBuzz implementation in Forth! ...
6
votes
1
answer
401
views
Toy Forth interpreter
I've been reading too many papers and writing too little code. These are my first 300 lines of Haskell:
...