Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
284 views
in Technique[技术] by (71.8m points)

How Do I Reset The A 'Score Bank' In My Program? Python

So I'm trying to add in a scoring system with an external module in a really basic game as I just started Python two days ago.

score_history = [0]

a=cur_score()

def var1():
    scoremodule.cur_score()

def initial_score():
    return score[0]

def cur_score():
    return score_history[-1]

def affect_score(delta):
    score_history.append(cur_score() + delta)
    return cur_score()

def reset_score(var1):
    sub=a-a
    print(sub)

Here's what I have so far. I just need a way to reset the score with the reset_score argument. I can't figure out how to assign cur_score a letter or subtract it from its self. Help would be much appreciated.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

what do you want reset_score to do? set a = 0?

def reset_score(var1()):
    a=0

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...