Author Topic: Score Adding  (Read 1046 times)

0 Members and 1 Guest are viewing this topic.

Offline bikemadness

  • Amiga 1200
  • ****
  • Posts: 312
  • Karma: 25
  • Hard players don't go home.
    • View Profile
Score Adding
« on: October 12, 2021 »
This was added to an old board.

It's a print version.

I wanted to see it in text.

Code: [Select]
table=10
dim names$(table)
dim scores(table)

for s=1 to table
read names$(s)
read scores(s)
next s

repeat
clear screen

for s=1 to table
print names$(s),left$(space$,10-len(names$(s))),scores(s)
next s

print "input new name",
line input n$
n$=lower$(n$)

print "input score for ",n$
line input s$
sc=val(s$)

for s=1 to table
if scores(s)<sc then

for t=table-1 to s step-1
scores(t+1)=scores(t)
names$(t+1)=names$(t)
next t

scores(s)=sc
names$(s)=n$
s=table+1
fi
next s

until (n$="quit")
end

data "nino",1000
data "jim",900
data "jinx",800
data "shadow",700
data "99t",600
data "toni",500
data "fryer",400
data "yalupine",300
data "peachy",200
data "gaurk",100

And here it is. With some additions.

It also solved wanting search as you type.

Code: [Select]
table=20
dim names$(table)
dim scores(table)

for s=1 to table
read names$(s)
read scores(s)
next s

dim g$(8)
dim z$(8)

open window 640,512
repeat
clear window
row=0
lit=1

for s=1 to table
if scores(s)>sc lit=lit+1
row=row+1
text 200-len(names$(s))*10,row*20+50,names$(s)
text 220,row*20+50,str$(scores(s))
next s

if lit=1 x$="st"
if lit=2 x$="nd"
if lit=3 x$="rd"
if lit>3 x$="th"

text 20,500,"We have a new score from "+n$+" with "+str$(sc)+" in "+str$(lit)+x$+" place."

for a=1 to 8
g$(a)=""
next a

text 20,20,"input name"

for a=1 to 8
g$(a)=inkey$
if g$(a)="enter" goto skip1
n$=g$(1)+g$(2)+g$(3)+g$(4)+g$(5)+g$(6)+g$(7)+g$(8)
text 20,40,n$
next a

label skip1

for a=1 to 8
z$(a)=""
next a

text 20,60,"input score"

for a=1 to 8
z$(a)=inkey$
if z$(a)="enter" goto skip2
s$=z$(1)+z$(2)+z$(3)+z$(4)+z$(5)+z$(6)+z$(7)+z$(8)
text 20,80,s$
next a

label skip2

sc=val(s$)

for s=1 to table
if scores(s)<sc then
for t=table-1 to s step-1
scores(t+1)=scores(t)
names$(t+1)=names$(t)
next t

scores(s)=sc
names$(s)=n$
s=table+1
endif
next s

until (1=0)

data "nino",1000
data "jim",900
data "jinx",800
data "shadow",700
data "99t",600
data "toni",500
data "fryer",400
data "yalupine",300
data "peachy",200
data "gaurk",100
data "",0
data "",0
data "",0
data "",0
data "",0
data "",0
data "",0
data "",0
data "",0
data "",0

Have a Yahappy day.
I don't know what is wrong with the world - but I know how to fix it.