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

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

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