DANI: A poetry writing chatbot from 1987 arrives in 2023

This semester my OOP students programmed a sonnet writing chatbot called DANI, for their programming test. Here are a couple of DANI’s poems:

father let this in thee shall shine
identify do mine only care i ensconce
who calls thee releasing
fleeting year would have lookd on the
thine heir might have faculty by us
thrall
bed
liii
presence grace impiety
wane so suited and sun of hand
untrue
sending a united states who will believe
project gutenbergtm license apply to anyone in
nurseth the lease of compliance to identify

adding one most which the deathbed whereon
travel forth all away yourself in process
seen the wretch to complying with frost
being fond on men ride
whateer thy minds to occur a son
reported to prove me words respect
famine where i cannot contain a bastard
thorns did exceed
effectually is had stoln of year thou
treasure of skill and unfatherd fruit
liii
5000 are restord and distribution of hearsay
ill well esteemd
stole that fair friend for through 1e7

DANI works, by loading a text document and storing a list of each word from the document along with a list of what words follow the word. This is called the model. For example, for this input file:

i love Star Trek
love is love
I love TU Dublin 

DANI will generate the following model:

i: love(2) 
love: star(1) is(1) tu(1) 
star: trek(1)
trek:
is: love(1)
tu: dublin(1)
dublin:

Each word is listed once in the model, regardless of how many times it occurs in the document. Each word is printed and all of the words that follow the word in the text with a count of how many times it follows the word are listed. In the above example, the words star is and tu follow the word love with a count of 1 each. The word i is followed by the word love twice.

To write a poem, DANI picks one word at random from the model and starts with that. DANI then looks to see what possible words will follow the chosen word and it picks one at random from the list for the next word. It then repeats the process until it has 8 words, or until it finds a word that has nothing following it – in which case it will terminate the sentence. It does this 14 times to write a poem as there are 14 lines in a sonnet.

For the test, the students used a text file of Shakespeare sonnets. Here is the full test & starter code. And the solution.

DANI stands for Dynamic Artificial Non-Intelligence. It is a chatbot for the MSX that was invented by Sean Davidson and published, with source code in MSX Computing magazine in 1987. I fondly recall typing the program (in MSX Basic) into my Spectravideo SVI-728 MSX computer and seeing my computer produce amusing responses to my prompts. Unfortunately, all pictures are lost of this amazing breakthrough, but here is a picture that the AI made of this:

Here is are some pages from the article in MSX Computing:

The full article is here.

DANI is an n-gram language model, where n is 1. 5-gram language models were state-of the-art text generators not so long ago. What is interesting is that if you copy-and-paste the test into Chat-GPT3, it will produce a solution which is 100% correct and this is what many of my students did :-(.

Godot 4. The game engine I have been waiting for

Godot = flow state

Godot 4 has just been released! I I cant believe it even exists its so amazing. The scripting language is similar to python, but totally specialised for making games. Code can be edited LIVE and the running game updates. A beautiful fully featured IDE. The node system is very intuitive. 2D and 3D. A full build of a project and deploy to the Quest takes 20 seconds. I am in love with Godot. ❤❤❤. Its the best thing since MSX Basic. It is the future of game development and will be used not only by indies but also in schools, colleges to teaching coding. It’s 100% free, open source, cross, platform, fully featured, versatile and light-weight game engine.

If you are interested in checking out my Godot experiments this is my repo with lots of examples of Boids, transforms, timers etc etc.

https://github.com/skooter500/GE2-2023

Building it up each week and live streaming my development on YouTube, so subscribe to my channel youtube.com/skooter500

Congratulations to the Godot team on making an amazing game engine that makes game development so pleasurable!

Ice Baths for Babies

Recently, I posted a link to an article discussing the best way to give an ice bath to a baby on my Facebook page. Many people got upset and offended. People berated me for promoting the practice. People told me I should take the page down as a baby might get killed. The truth is – I have no idea if giving an ice bath to a new born baby is a good idea or not. I doubt it! That wasn’t the point of the article.

The page in question was generated by AI. I used chatgpt3 to generate the articles from prompts like “Write an article for a women’s magazine about whether to lower babies into ice baths by the head or by the feet” and “Write testimonials from parents about the benefits of giving daily ice baths to babies”. The resulting articles were creepy, hilarious and brilliant. I used Stable Diffusion to generate various pictures of smiling babies in baths of ice and put the whole lot into a Facebook page. I shared the article and it was interesting to observe how many people accepted it as real without noticing that all the babies have extra fingers and limbs, and the text doesn’t make sense in some of the articles.

I was inspired to create Ice Baths for Babies by these cool projects:

The Leeds 13

In 1998 a group of art students faked a trip to Malaga and leaked to the press that they had spent their grant money on the holiday. The group kept the pretence up for a week and revealed the truth a week later on a radio program they were invited onto to answer accusations from a hostile panel of commentators. Here is a great Vice documentary about the project:

A Modest Proposal

“A Modest Proposal For preventing the Children of Poor People From being a Burthen to Their Parents or Country, and For making them Beneficial to the Publick is a satirical essay published anonymously by Jonathan Swift in 1729.

The essay suggests that impoverished Irish families might ease their economic troubles by selling their children as food to the rich. The essay includes various suggestions for ways that children might be cooked. For example:

“A young healthy child well nursed, is, at a year old, a most delicious nourishing and wholesome food, whether stewed, roasted, baked, or boiled; and I make no doubt that it will equally serve in a fricassee, or a ragout”.

Mmmm delicious!

The fact is – there are amazing things happening in the field of Computer Science right now. chatgpt3 and Stable Diffusion are statistical models trained on billions of examples of text, question and answers, images and videos. The are the non-conscious intelligences, that Yuval Noah Harari wrote about in his book Homo Deus.

The are not people or animals. The do not have a soul, nor are they alive. But they are not search engines either. They are something totally different and nobody – not even the computer scientists knows quite what they are and what to do with them yet. I am thinking or all the ways this technology will make tedious tasks like writing exam papers, grant applications and code examples less time consuming and will improve my productivity. They amazing tools for creative thinking, though of course they make creating and spreading fake news really easy too which is all the more reason for people to question.

Hopefully this project got you thinking about Computer Science, Ethics, Fake News, Cognitive Biases Art, etc. etc.

As Oscar Wilde wrote:

“There is no such thing as a moral or an immoral book. Books are well written or badly written. That is all.”

Nematodes

I recently read a fascinating thesis about nematodes. Nematodes are the most abundant multicellular organisms on the planet and there are around 40 quintillion of them. Inspired by the humble nematode, I wrote two programming lab tests.

This one is for fourth year Games Engines students and it uses C# and Unity to create a simulation of a school of nematodes swimming and wriggling and avoiding each other:

https://github.com/skooter500/GE2-Test-2022-Starter

This one for second year OOP students and it uses java and the processing libraries to visualise a fictitious dataset of nematodes: 

https://github.com/skooter500/OOP-Test-2022-Starter

Here are the solutions:

https://github.com/skooter500/GE2-Test-2022

https://github.com/skooter500/OOP-Test-2022