BAK/Problem Solving, Python Programming, and

Coursera 강의,Problem Solving, Python Programming, and Video Games 3주차

게임이 더 좋아 2020. 5. 1. 19:29
반응형
728x170

3주차의 목표

 

  • Generate the tokens in a Python program using lexical tables and rules for: identifier, literal and delimiter.
  • Validate the syntax of a Python program, using syntax diagrams for: expression statement, expression, and function call.
  • Validate the semantics of a Python program, using simplified semantic rules for: identifier, literal and function call.
  • Predict the outcome of evaluating a Python program that contains these language components: identifiers, literals and function calls.
  • Create a Python program that produces a specific outcome, from a description of the outcome, using these language components: identifiers, literals and function calls.
  • Create a simple text-based game with a single gameplay path (Hacking Version 1), using the Wing IDE, uagame library and a functional test plan.
  • Recognize the order of tasks in the Create Game Process.
  • Recognize language features in a Python program: identifer, literal, function call, int, float, str
  • Use a Python shell to evaluate a built-in function call.
  • Predict what a built-in function does, by using the documentation at python.org.
  • Recognize a literal string, based on examples.
  • Predict the outcome of evaluating some statements in a subset of English as: lexical error, syntax error, semantic error or valid.
  • Apply the longest token rule to generate the correct tokens from a character sequence.
  • Recognize the value, type and identity of an object.

 

 

 

 

 

 

 

 

 

 

 

 

 


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


 

 

 

 

 


 

 

 

 

 

 

 

 

 

 


 

 

 

 

 

 

 


 

 

# Hacking Version 1
# This is a text-based password guessing game that displays a 
# list of potential computer passwords. The player is allowed 
# 1 attempt to guess the password. The game indicates that the 
# player failed to guess the password correctly.

# display header
print('DEBUG MODE')
print('1 ATTEMPT(S) LEFT')
print('')

# display password list
print('PROVIDE')
print('SETTING')
print('CANTINA')
print('CUTTING')
print('HUNTERS')
print('SURVIVE')
print('HEARING')
print('HUNTING')
print('REALIZE')
print('NOTHING')
print('OVERLAP')
print('FINDING')
print('PUTTING')
print('')

# prompt for guess
input('Enter password >')
    
# end game
#   display failure outcome
print('LOGIN FAILURE - TERMINAL LOCKED')
print('')
print('PLEASE CONTACT AN ADMINISTRATOR')
print('')
    
#   prompt for end
input('PRESS ENTER TO EXIT')

 


순서

반응형
그리드형