\ We need NOVICE.4TH and LIST.4TH already compiled.

marker TEST.4th

list
    w field .n
constant int

: init-int ( n node -- node )    
    init-list
    tuck .n ! ;
    
: new-int ( n -- node )    
    int alloc
    init-int ;

: int> ( new-node node -- new-node )    
    .n @  over .n @  u> ;
    
: fill-int { cnt -- head }
    nil  ['] int>
    cnt 0 ?do
        cnt rnd new-int  insert-ordered
        loop drop ;

: <int*> ( multiplier node -- multiplier )        
    >r
    r@ .n @  over *
    r> .n ! ;
        
: int* ( multiplier head -- )        
    ['] <int*> each drop ;
    
: <evens> ( -1 evens... node -- -1 evens... )    
    .n @  dup 1 and if  drop  then ;
    
: evens ( head -- -1 evens... )    
    -1
    swap ['] <evens> each ;

: <find3> ( node -- flag )    
    .n @  3 = ;
    
: find3 ( head -- node|false )    
    ['] <find3> find-node ;
                        
: <show-int> ( node -- )        
    .n @ .  cr ;
            
: show-int ( head -- )        
    cr
    ['] <show-int> each ;
    
: show-int ( head -- )        
    cr  
    each[  .n @ .  cr  ]each ;