Python代写:CS104 Noughts and Crosses

代写Python基础作业,根据已学的知识,完成一个游戏。

Summary of the scope of the task and the rules

  • The objective of Assignment 2 is to write an original Python program that shows off your Python programming skills and some of your creative flair.
  • In contrast to the Scratch assignment, we will suggest some potential topics for your assignment (see below). It will be possible to get a solid but unspectacular mark by good delivery of one of these standard topics. But to get a top mark, you will need to either
    • stretch significantly the boundaries of one of the standard topics; or
    • work in a fresh application area of your own devising.
  • This assignment is worth 60% of your overall mark for “Introduction to Computer Programming”.
  • The deliverables will be:
    • A working Python program in the form of a .py file (or potentially a collection of files which are collected together as a .zip). We will only be accepting projects in Python 3 or above.
    • A short report (in .pdf format) of 1-2 pages in length, with the following format:
      • Describe the goal and motivation behind your project.
      • Cite your sources. Mention any external code used with clear URLs. Please also add delimiters using comments in your code.
      • How you use the program (it should be clear from the game itself, this should be short).
      • [very important] What were the design decisions?
      • [very important] Challenges encountered and how you overcame them (at least one).
      • Anything else you would like to highlight.
  • If for some reason, you cannot submit by the deadline, you need to seek approval from Helmut or Sabine before the deadline.
  • For this assignment, it is required that you submit individual work. You may discuss the creative scope of your assignments with each other, but you must work individually on the programming and the accompanying report. We will cross-check projects!

What should a good assignment do?

  • Show off your programming skills: a good project should demonstrate solid and non-trivial use of a wide range of basic Python programming constructs and ideas that we have covered so far. If you don’t attempt to use more complex data types, functions, object oriented features (classes) etc., you will loose marks.
  • Stylistically, good programs should: include comments; use a good variable naming convention i.e., CamelCase; they should be well-structured and avoid needlessly long and repeating code. Loops, functions and classes should be used where appropriate to simplify the structure of the code and make it more taut and readable. Make sure you use the right variable types or data structures.
  • (For higher marks) show some imaginative flair. We are not going to be demanding this to the same level as we were with the Scratch assignment. But potentially good flair could mean using a number of modules, either those built-in to Python, or downloaded from the internet, and combining their use in some interesting way.

Project selection / approval procedure

We want to make that you start thinking about your projects now and that you choose that are feasible. Therefore, there will shortly be a facility open on Blackboard for you to indicate that either (i) you have chosen one of the standard shape projects or (ii) for you to describe a different idea that you would like to follow.

Lab time

We will set aside time to work on your projects in the labs and to ask questions as the need arises. There will be only reduced worksheets. Note that we expect a top-end assignment to take more time than what is allocated during lab sessions. But this assignment shouldn’t ruin your Christmas. It should be enough to put in some solid time before you go away. If you wish to work at home on this during the Christmas break that is fine, but it shouldn’t be necessary.

Possible Python Projects

A simple text interaction game. Note that these are bare minimum and need to work flawlessly to pass.

  • Noughts and Crosses or Mastermind (but that is too simple - unless perhaps you try to build intelligence into the game for the computer opponent).
  • Maze solving (read different text based mazes from a file, display it, and solve it for the shortest way).
  • Chess, Connect Four, or Drafts - or other board games - NB need to build in the rules of the pieces etc. (Having a “computer player” is too hard.)
  • Card games of various kinds (Poker, Solitary etc.).
  • Scrabble - asking the player to find best scoring words from a randomly generated rack. (NB you can database of words online).

Scratch was designed to build games, however, Python is much more versatile. We recommend you not just going for a game, but also think about more engineering based applications, for example:

  • A physical simulator (using odeint for integration)
  • A complex calculator capable of using statistics
  • Analysis and extracting data from data files and plotting them
  • Drawing application

You can achieve higher marks by adding complexity to the program, for example:

  1. Read and write data from and to a file.
  2. For games you could include an AI for one of the players.
  3. Build a Graphical User Interface (GUI) with the Tkinter module or matplotlib (or a combination of both) to show results and/or have user interaction
  4. Combine previous points

NB you will be generally ok using modules which are built-in to Python 3.0 (the standard library) and the ones that we present, i.e., PyGame, Tkinter, Numpy, matplotlib. But for some more interesting tasks, you might want to experiment with downloading 3rd party modules off the internet and using these. However, the use of 3rd party modules needs prior approval by Helmut or Michael (on Blackboard). The code needs to run “as submitted”, and special modules are not supported by the staff. In summary, this is a higher risk approach and only suitable if you are very confident with your computer skills.

How do we mark your projects

NB During the marking process we check for plagiarism! We have 5 categories we mark for:

  • Originality (5 points): see possible project descriptions above varying in originality from those that are pre-proposed simple text interaction game, to programs that pro- vide a twist on a known game, creative flare, or are entirely original.
  • Challenge (10 points): see difficulty levels above varying from a basic text-based pro- grams to ones that uses AI, GUI, default modules vs. external modules.
  • Features (5 points): makes appropriate use of data types, functions, and classes and modules.
  • Implementation (5 points):the code is well structured, taut and commented, use of CamelCase, is easy to read.
  • Usability (5 points): the code is easy to install and use. It’s clear for a new user how to use the program. The user experience is good. The code isn’t buggy, and it is fool-proof (for example by checking user inputs to avoid improper use).
  • Report (10 points): The report provides meaningful information, is easy to read, and follows the required structure.