Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

rknightuk/python-patchwork

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python patchwork coursework

To get this run now (as of 2023) remove all the input stuff in final.py

Python coursework for Year 1 Introduction to Programming (INTPROG). Known issues:

  • Swapping of tiles (advanced) will not work when swapping tiles that have already been swapped.

Coursework spec:

Main program requirements

Your program should begin by prompting the user to enter:

  • the sample dimensions (i.e. the width & height in terms of patches);
  • the desired four colours (which your program should ensure are all different from each other).

The program’s user interface should be friendly and robust; e.g., on entering invaliddata, the user should be re-prompted until the entered data is valid. (Valid widths andheights are integers between 2 and 8, and valid colours are red, green, blue, yellow,magenta and cyan.) Once these details have been entered, the sample should be drawn in agraphics window of the appropriate size. For example, if the user enters a width of 6, aheight of 3, and colours red, green, blue and yellow, then (in the case that yourstudent number ends in 56) the sample shown above should be drawn in a graphics windowof width 600 pixels and height 300 pixels.

Advanced program features

The above requirements are what I expect most students to attempt, and carry the vast majority of the marks for functionality. If you would like a further challenge for a fewadditional marks, then I encourage you to attempt this additional part. After the patchwork design has been drawn, you should allow the user to change it by clicking on the window with the mouse. To make a change, the user clicks within twoseparate patches. This should cause those two patches to be swapped (i.e. both thedesign and the colour). The user should be able to make as many patch swaps as they wish.

About

Python coursework for Year 1 Introduction to Programming (INTPROG).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages