# A new book teaches AI from scratch in BASIC on the Z80

Original title: Artificial Intelligence for the Z80

> Hacker News story 50485275 · language: en · submitted 2026-11-13
> Web version: https://zeli.app/story/50485275
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 87 · by [AlexeyBrin](<https://news.ycombinator.com/user?id=AlexeyBrin>) · 💬 8
[original](<https://www.dfsantos.com/en/libro-ia-z80>) · [HN discussion](<https://news.ycombinator.com/item?id=50485275>)

## Summary

A 12-chapter book builds artificial intelligence from the ground up in BASIC on 8-bit machines like the ZX Spectrum and Spectrum Next. It covers sorting-algorithm benchmarks, expert systems, an ELIZA-style chatbot, Minimax tic-tac-toe, linear regression on Mauna Loa CO₂ data, k-NN and Naive Bayes classifiers, k-means clustering, perceptrons, backpropagation for digit recognition, and the Game of Life. Complete listings and experiments are available in two editions, Spanish and English.

## Key quote

> What happens when we bring the foundations of artificial intelligence to an 8-bit machine?

## HN discussion (8 comments)

### [mk_stjames](<https://news.ycombinator.com/item?id=50514063>)

> I would have called it "... A.I. in BASIC / on the ZX Spectrum" not "for the Z80" - even though you are running BASIC to interpret the programs on a Z80 cpu, it doesn't seem like the learnings have anything to do with a Z80, and would translate to anyone wanting to tinker with this in any similar BASIC dialect (unless your programs use inlined machine code more in later chapters).
>
> Based on the title alone I would have imagined more of it would be in Z80 Assembly (which... is as fun IMO)

### [grodriguez100](<https://news.ycombinator.com/item?id=50514933>)

> I love the worn-out look of the cover. Brings fond memories of the original ZX Spectrum user manuals.

### [anthk](<https://news.ycombinator.com/item?id=50515894>)

> Thanks/Gracias. Will it work under OpenSE? OpenSE it's a libre implementation of the ZX Spectrum ROM for the 48k model.
>
> BTW, the code for the book.
>
> Spanish: https://github.com/dfernande132/IA_Z80
>
> English: https://github.com/dfernande132/AI_Z80

---

## Cite

- Page: https://zeli.app/story/50485275
- Date: 2026-11-13
- Source: dfsantos.com (https://www.dfsantos.com/en/libro-ia-z80)
- Hacker News: https://news.ycombinator.com/item?id=50485275

## Other languages

- zh: https://zeli.app/zh/story/50485275 · markdown: https://zeli.app/zh/story/50485275.md
- ja: https://zeli.app/ja/story/50485275 · markdown: https://zeli.app/ja/story/50485275.md
- ko: https://zeli.app/ko/story/50485275 · markdown: https://zeli.app/ko/story/50485275.md
- de: https://zeli.app/de/story/50485275 · markdown: https://zeli.app/de/story/50485275.md
- es: https://zeli.app/es/story/50485275 · markdown: https://zeli.app/es/story/50485275.md
- ru: https://zeli.app/ru/story/50485275 · markdown: https://zeli.app/ru/story/50485275.md
