Live data from Hacker News

Toothpaste Null-Terminator

dunkels.com

1–10 of 81 posts

Re: Toothpaste Null-Terminator

#9
Buy two tubes, while true, when you finish a tube, add one toothpaste tube to the shopping list, done.

Works great for an average person who usually visits the store. Adjust the initial putchase if you visit the store twice a year.

Also works great for many suplies like coffee, pasta, legumes...

Re: Toothpaste Null-Terminator

#10
I don’t understand how this works with systems like toothpaste? I get if you somehow stored your toothpaste in some queue-like structure where you only see 1 at a time, then yes, reaching the last would be helpful. But surely they are in a cupboard or drawer or something?

To know to start the sentinel toothpaste he must search around and prove it’s the only one left - by doing this he doesn’t need the sentinel anyway, as the searching process with yield only one, sentinel or not?

If it doesn’t need a search, e.g. they are in a line/all on easy view - then it’s obvious it’s the last even without a sentinel?

Post reply on HN