  We develop the theory of the $W$ and $Z$ scale functions for right-continuous
(upwards skip-free) discrete-time discrete-space random walks, along the lines
of the analogue theory for spectrally negative L\'evy processes. Notably, we
introduce for the first time in this context the one and two-parameter scale
functions $Z$, which appear for example in the joint problem of deficit at ruin
and time of ruin, and in problems concerning the walk reflected at an upper
barrier. Comparisons are made between the various theories of scale functions
as one makes time and/or space continuous. The theory is shown to be fruitful
by providing a convenient unified framework for studying dividends-capital
injection problems under various objectives, for the so-called compound
binomial risk model of actuarial science.
