300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > Code Combat学习心得(Kithgard地牢45关Mightier Than the Sword)

Code Combat学习心得(Kithgard地牢45关Mightier Than the Sword)

时间:2023-01-18 14:27:32

相关推荐

Code Combat学习心得(Kithgard地牢45关Mightier Than the Sword)

代码来自(Kithgard地牢45关Mightier Than the Sword)

# A variable is a way of holding on to a value.

#变量是一种保存值的方式。

# Here the "password" variable holds the secret phrase we need.#这里“password”变量保存我们需要的密码。

#定义密码为'Secret Message'

password = 'Secret Message'

hero.moveUp()

hero.moveRight()

hero.say(password) #说出变量“password”中包涵的值'Secret Message'

# A variable changes its value whenever you assign it.

#每当您给变量赋予新的值时,变量都会换为新的值。

#给变量”password“赋予新的值“'So Many Doors'

password = 'So Many Doors'

hero.moveRight()

# Change the string in this line to the password variable.

# 在“说“变量时候不要加引号,直接输入变量名称。此处说的密码就是新的值”So Many Doors”

hero.say(password)

hero.moveRight()

password = 'Let Me Out Of Here'

# Move to the last door and say the password variable to open it.

#移动到最后一扇门并说出新密码变量'Let Me Out Of Here'以打开它。

hero.say(password)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。