In which we go faster This is a bit of an interlude. At this point, I've built a serviceable computing engine that's not quite a Forth implementation but is capable of any computation. We can now look at refactoring some parts of it with respect to increasing performance. At the same time, we want to … Continue reading Forth and the Furious
Blog
Go Forth and Multiply – or Don’t
In which I provide my Forth machine with the ability to make decisions Now it is time to revisit branching. Provide builtin branch and branch? words.http://beza1e1.tuxen.de/articles/forth.html We'll first need to do some refactoring because, in order to jump somewhere, our list of instructions needs to be indexable. In fact, it needs to be bidirectionally indexable. The branch instruction will … Continue reading Go Forth and Multiply – or Don’t
May the Forth be With You – Programs
In which I create a state machine and compile simple programs but I don't implement branches Provide builtin branch and branch? words.http://beza1e1.tuxen.de/articles/forth.html Seems simple enough... ... oh wait, how can I branch somewhere if I don't have the concept of a program, or a list of words at the least. I'll create the words for now, but I won't … Continue reading May the Forth be With You – Programs
May the Forth Be With You – The Dictionary
In which I create a dictionary of words and an interpreter This is series of posts based on a blog by Andreas Zwinkau. Exercise 2 Create a dictionary of some sort. Initialize it with the words + and print. Execute programs like 2 3 4 + + print.http://beza1e1.tuxen.de/articles/forth.html This is where things get interesting. Prior to the exercise, Andread … Continue reading May the Forth Be With You – The Dictionary
May the Forth be With You
In which I write a simple word parser My project for the weekend is a Forth interpreter. I stumbled across a web site that tells you how to write one. I say "interpreter" because a compiler involves messy things like machine code and I don't want to go there just yet. Exercise 1 Read Forth … Continue reading May the Forth be With You
Pandemic Two – Self Isolation
Previously, I wrote a simple pandemic simulation. Now I have extended it to model self isolation measures. To do this I changed the model in the following ways: the virus has an extra property which is the period immediately after infection for which the patient is asymptomatic.The population now has two levels of sociability: one … Continue reading Pandemic Two – Self Isolation
Pandemic
Given all the interest in modelling pandemics at the moment, I decided I'd write my own pandemic simulation. After all, it can't be any harder than the botched job done by the Imperial College model. Before we start, I need to point out that I know absolutely nothing about epidemiology. This will quickly become apparent … Continue reading Pandemic
Noughts and Crosses part 2 – the Minimax Player
It took some time, but I have finished the Minimax player. I've tested it and it seems to be unbeatable, as you would hope. The main reason it took so long is because it is pretty slow, at least in the original naive version. The code for the version I am discussing is tagged blog-928. … Continue reading Noughts and Crosses part 2 – the Minimax Player
Noughts and Crosses
Hannah Fry was the presenter of this year's Royal Institution Christmas Lectures. There were some beautiful demonstrations (in my opinion) on several mathematical subjects that have relevance in the real world. The demonstration of how vaccination is effective using the zombie apocalypse was very thought provoking as was the Christmas present detection machine, which was … Continue reading Noughts and Crosses
Accessing Resources from Test Cases in Swift
This is just a reminder from me to me. I constantly find myself searching through my previous projects trying to remember how to do this. Putting it in my blog might make it easier to find it in future. Quite often, when writing test cases, I want to access resources that are not Swift code. … Continue reading Accessing Resources from Test Cases in Swift