# Aleksey Kladov - Generate All the Things (Highlights)

## Metadata
**Review**:: [readwise.io](https://readwise.io/bookreview/56561453)
**Source**:: #from/readwise #from/reader
**Zettel**:: #zettel/fleeting
**Status**:: #x
**Authors**:: [[Aleksey Kladov]]
**Full Title**:: Generate All the Things
**Category**:: #articles #readwise/articles
**Category Icon**:: 📰
**URL**:: [matklad.github.io](https://matklad.github.io/2021/11/07/generate-all-the-things.html)
**Host**:: [[matklad.github.io]]
**Highlighted**:: [[2025-11-30]]
**Created**:: [[2025-12-06]]
## Highlights
- On each iteration, we will remember the sequence of numbers we generated together with bounds the user requested ([View Highlight](https://read.readwise.io/read/01kb9eha485dwdg95ay21qrqnm)) ^962128987
- In the first iteration, create memory for each invocation.
- User will cann `done()` to see permutation has done. Use the function to update memory for the next iteration.
- Following iteration will use memory to provide values for each invocation.
- As we store zeros implicitly anyway, we can just truncate the vector in `done` instead of zeroing-out the elements after the incremented one. ([View Highlight](https://read.readwise.io/read/01kb9eygjzyxsn8q2wkrqdyf8n)) ^962129768