-
Notifications
You must be signed in to change notification settings - Fork 2
Python syntax
Maciej Jankowski edited this page Jun 3, 2019
·
4 revisions
You can learn the basics of syntax here:
- Very basic python intro in just 30 minutes - (watch until ~32:00)
- condensed python language guide
- python course
After reading this you should know about:
- statements
- expressions
- if, for, while
For now I will use the code we written using Flowcharts and translate it into python:
player1_name = ""
player2_name = ""
def draw_board():
pass
def ask_for_position_X():
# return position
pass
def put_X_on_the_board(position):
pass
def is_game_over():
# if no_moves_left() or row_of_3():
# return true
# else:
return False
def new_round():
pass
def show_winner():
pass
def no_moves_left():
return False
def row_of_3():
pass
After we have all the pieces we should Code the functions