Assignment 3

Question 1 (5 Marks)

Make a Tic Tac Toe game played by two human players . The board can have a structure similar to what's given below.

Features to be present:

  1. Modular code, Use OOP paradigms.
  2. The program should exit after n games
  3. Maintain a scoreboard that is displayed after completion of every game. Draw gives each player a score of 1. A winner gets a score of 3

Bonus Features (You will not be graded on these)

  1. Enable the users to select their customs nicks.
  2. Use simplegui to draw the board out.
  3. Make player two a computer player ( Make sure he never loses :P )


In [ ]:
'''
----------- ---------- ----------- 
|          |         |    O      | 
----------- ---------- -----------  
|     X    |         |           | 
----------- ---------- -----------
|          |         |           | 
----------- ---------- -----------
'''

Question 2 (5 marks)

Universal Calculator Write a class calculator that implements the basic functionalities of a calculator, namely the 4 operators (+, -, /, *). Apart from int,float etc, the class should also be able to handle list and tuple data-types. The operators on lists and tuples are defined element wise. Assume that the length of the lists and the tuples are same.

Example-
List1=[2,3,4]
List2=[0,4,2]
Then List1 * List2 should return [0,12,8].
Also, define the functionality to operate element-wise on list/tuple and integer/float data types.
Example-
a=2
Then a * List1 should return [4,6,8]


In [ ]: