[Tutor] "complete number" algorithm

Andrei Kulakov ak@silmarill.org
Sat, 22 Jun 2002 17:28:19 -0400


On Sat, Jun 22, 2002 at 01:39:21PM -0700, Sean 'Shaleh' Perry wrote:
> 
> On 22-Jun-2002 Andrei Kulakov wrote:
> > Hello tutor crowd,
> > 
> > I'm working on a small algorithm that determines if a digit can be
> > added at the end of one number and it could still be equal to or less
> > than another number. This is for an on-screen list where you have to
> > pick an item, each of them is numbered like this:
> > 
> 
> why not mark each item as the user types and let them choose?
> 
> 1
> 2
> 3
> 4
> 5
> 6
> 6
> 8
> 9
> 10
> 11
> 12
> ...
> ...
> ...
> 122
> 
> if the user types '1' then 1 gets hilighted.  if the user then presses '2' the
> hilight moves to 12.  If they then press '1' it ends up on 121.  You can have
> the "mark an item" function check the delay between keypresses and if the delay
> is longer than a chosen time assume they started over.
> 
> This would work like emacs' search (C-s).
> 
> 

Well, the thing is, I'm not using curses, just plain terminal. Besides,
this would need some sort of termination keypress, I'd prefer this to
be just the number. This will choose songs out of playlist and
directories (albums) out of directory list, so it's something a user
may do very often, and even one saved keypress is significant, I think.

 - Andrei

-- 
Cymbaline: intelligent learning mp3 player - python, linux, console.
get it at: cy.silmarill.org