1753918 Members
7718 Online
108810 Solutions
New Discussion юеВ

counter

 
kathy Goldie_1
Occasional Contributor

counter

need to create a counter in quiz,
def counter num*2=0
def counter1 num*2=1
def counter2 num*2=counter+counter1
def counter3 num*2=counter2+counter1

but I cant figure out how to make it increment? - sound dumb - it is sorry!
2 REPLIES 2
Michael Steele_2
Honored Contributor

Re: counter

Hi

What language? 'C'?

Is this a binary problem?
2**0 = 1
2**1 = 2
2**2 = 4, etc.

Where is your procedure / code so far?

Here's an untested approximatation for korn shell for a binary counter.

while :
do
EXP=$(($EXP+1))
TOT=$((2**$EXP))
if [[ $EXP -eq 9 ]]
then
break
fi
done
Support Fatherhood - Stop Family Law
kathy Goldie_1
Occasional Contributor

Re: counter

DEFINE KNTR NUM*6 = 1
DEF NKNTR NUM*6=1
DEFINE TAG NUMERIC*6 = (NKNTR - 1) + KNTR
REP ITNO KNTR SUBT NORESET