Programming II – Labs 2019/20

“Life is not a game. Still, in this life, we choose the games we live to play.”
― J.R. Rim

So hopefully, you have chosen (or has been assigned to) a fun labs for Programming II.  It is going to be about C# and OOP and (sometimes) Games.

Permalink: http://bit.ly/mff-uk-prg2-labs-2020


News

Follow the appropriate channel at Gamedev Discord!
https://discord.gg/c49DHBJ


Dates

Standard labs – Friday, SW2, 8:30


How to pass the practice

In order to get credits from me, you have to

  1. Deliver a semester project of your choice
  2. Pass the labs
    • To pass the labs you must obtain at least 110 points by the 15.5.2020
    • If you do, then there are two ways how to pass the labs
      1. Obtain at least 130 points and pass the “final labs test” (this option is available only during “labs test”)
      2. Obtain at least 170 points (if you fail all the “labs tests”, you have to go for this one)
    • COVID19 update – Obtain at least 170 points
  • You can get points by:
    1. Attending workshops and writing quick tests at their beginning
    2. Doing homeworks (and submitting them to me)
      • When submitting a homework, always use the name of the homework as the subject of the email!
    • Details can be read within this spreadsheet (GDrive)
    • All homeworks have relaxed deadlines, deliver them anytime you want but heed to the dates above!
    • COVID19 update – There are no deadlines for delivering homeworks (just the end of the semester)

Final Lab Tests

There are going to be 3 opportunities to do the lab final test
  1. Friday, 15.5.2020, 8:30, SW2
  2. Friday, 22.5.2020, 8:30, SW2
  3. Friday, 29.5.2020, 8:30, SW2

COVID19 update – There will be NO FINAL LAB TESTS, instead, we will have more labs and you will be given points for obtaining enough points from homeworks.


Semester Project


Some Useful Links

  • Algoritmy.net (in Czech) – overview of all basic but crucial data structures and algorithms
  • visualgo.net – visualization of selected data structures and algorithms

Lab 11 – Minimax and Alpha/beta

  • 22.5.2020 – Slides, YT
  • Classic 2-player board games and artificial players
  • Minimax algorithm and alpha/beta game tree pruning
  • PRG2 – 2020 – Homework 11 – TicTacRow
    • Create minimax player for TicTacRow (implementation of the game is provided)
    • Check slides 😉

Lab 10 – Software Testing

  • 15.5.2020 – Slides, YT
  • Software testing – definition, important types of testing
  • Unit testing and Code coverage
  • How to do unit testing using NUnit in MSVS
  • PRG2 – 2020 – Homework 10 – Code Coverage
    • Download sources for heap implementation
    • Provide complete coverage with tests
    • Fix the implementation along the way
    • Check slides 😉

Lab 09 – WinForms and GDI

  • 24.4.2020 – SlidesYT
  • WinForms, Windows Form Designer, GDI
  • Graph algorithms, Graph drawing algorithm based on springs
  • PRG2 – 2020 – Homework 09.1-6
    • Various homeworks that requires you to build Windows Form Application
    • Check slides 😉

Lab 08 – Dynamic Progamming

  • 17.4.2020 – Slides, YT
  • Dynamic programming and various tricky problems to solve
  • PRG2 – 2020 – Homework 08 – Dynamic Programming
    • Send me solutions to the problems described in slides
    • Send me an implementation of LCS algorithm
    • Check slides 😉

Lab 07 – Theme Hospital Lite – Discrete simulation

  • 3.4.2020 – Slides, YT
  • Non-virtual methods redefininitions (new), methods sealing, overriding ToString() and debugging
  • Discrete simulation architectures
  • PRG2 – 2020 – Homework 07 – THL Simulation
    • see the slides for the homework details
    • THL input is different a bit from Lab 06
    • implement discrete simulations for patients travelling through the hospital and doctors tending to them

Lab 06 – Theme Hospital Lite – Navigation

  • 27.3.2020 – Slides, YT
  • Enum type, SortedSet, Backus-Naur Form for definition of textual inputs, Regular expressions
  • Dijkstra’s algorithm for path-finding
  • PRG2 – 2020 – Homework 06.1 – THL Input
    • see the slides for the homework details
    • parse THL input using regular expressions
  • PRG2 – 2020 – Homework 06.2 – THL Navi
    • see the slides for the homework details
    • implement Dijkstra’s algorithm for patient navigation

Lab 05 – The Snake and OOP

  • 20.3.2020 – Slides, YT
  • OOP continues, inheritance, virtual methods, overriding, abstract classes
  • PRG2 – 2020 – Homework 05.1 – The Snake Stub
    • see the slides for the homework details
    • rewrite UML class diagram into C#, you can leave the methods blank (just make sure the project compiles)
  • PRG2 – 2020 – Homework 05.2 – The Snake Impl
    • see the slides for the homework details
    • implement the Snake game!
    • note that if you plan to do the both homeworks in one go, you can send be just this one for full 25 points

Lab 04 – DFS, BFS, Visitor pattern

  • 13.3.2020 – Slides, YT
  • We’ve been discussing Queue, Stack, HashSet, Dictionary (again), DFS and BFS for trees and graphs + visitor design pattern
  • PRG2 – 2020 – Homework 04 – GameBook II
    • see the slides for the homework details
    • you will receive code template once you finish the GameBook I homework

Lab 03 – C# and OOP – Simulator of Economics Games

  • 6.3.2020 – Slides
  • We have been modeling economic simulations, play the game!
  • We’ve been discussing Dictionary, Func and lambdas in C#
  • PRG2 – 2020 – Homework 03 – Hamurabi

Lab 02 – C# and OOP – Gentle Introduction Part II

  • 28.2.2020 – Slides
  • PRG2 – 2020 – Homework 02.1 – Calc
    • see the slides for the homework details
    • in a nutshell, you have to create an extendable calculator according to UML blueprint
  • PRG2 – 2020 – Homework 02.2 – CalcWithMemory
    • alter the UML blueprint of Calculator that will support implementation of a memory (store and recall operations)
    • you can use yEd tool for that (freeware) and start with original CalcUML (yEd file)

Lab 01 – C# and OOP – Gentle Introduction Part I

  • 21.2.2020 – Slides
  • PRG2 – 2020 – Homework 01 – GameBook I
    • see the slides for the homework details
    • in a nutshell, you have to create a program that will allow me to play a game book
      • you can start your implementation from here
    • If you are unsure, how the solution should look like, you can download following example solution, unzip it (whole zip! not just exe file), run it and observe it

Lab 00 – C# Crash Course

  • Download, unpack, open in Visual Studio and study the basic C# syntax from the CrashCourse solution
  • PRG2 – 2020 – Homework 00 – First Steps
    • Download and implement all the tasks from the FirstSteps project