Programming II – Labs 2020/21

“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.


News

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


Dates

Standard labs – Thursday, Zoom (you will receive the link by email), 15:40


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
    • Obtain at least 180 points from homeworks
  • You can get points by:
    1. Writing quick tests that are part of every lab (or lab video)
    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)
    • There are no deadlines for delivering homeworks (just “the end” of the semester)

Open Consultations

There will be no “final labs test”, instead, homeworks are somewhat more demanding. Plus there will be three “open consultations” conducted throughout the semester.
  1. Thursday, 18.3.2021, 15:40, online
  2. Thursday, 15.4.2020, 15:40, online
  3. Thursday, 13.5.2020, 15:40, online

For consultations to work, you need to come prepared! List questions you seek answers for, so we can crunch them effectively!


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 14 – Software Testing

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

Lab 13 – Minimax and Alpha/beta

  • 27.5.2020 – SlidesYT
  • Classic 2-player board games and artificial players
  • Minimax algorithm and alpha/beta game tree pruning
  • PRG2 – 2021 – Homework 10 – TicTacRow
    • Create minimax player for TicTacRow (implementation of the game is provided)
    • Check slides 😉

Lab 12 – Open Consultations 3

  • 20.5.2021
  • Q&A session!

Lab 11 – WinForms and GDI

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

Lab 10 – Dynamic Progamming

  • 6.5.2021 – SlidesYT
  • Dynamic programming and various tricky problems to solve
  • PRG2 – 2021 – Homework 08 – Dynamic Programming
    • Send me solutions to the problems described in slides
    • Send me an implementation of LCS algorithm
    • Check slides 😉

Lab 09 – Theme Hospital Lite – Discrete simulation

  • 29.4.2021 – SlidesYT
  • Non-virtual methods redefininitions (new), methods sealing, overriding ToString() and debugging
  • Discrete simulation architectures
  • PRG2 – 2021 – Homework 07 – THL Simulation
    • see the slides for the homework details
    • THL input is different a bit from what was specified for Lab 06
    • Implement discrete simulation for patients travelling through the hospital and doctors tending to their problems

Lab 08 – Open Consultations 2

  • 22.4.2021
  • Q&A session!
  • Use the following Google form to file the questions; fill the questionnaire no later than Wednesday 23:59!
  • I will sort them and then we go through them one by one in live session!

Lab 07 – Theme Hospital Lite – Navigation

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

Lab 06 – The Snake and OOP

  • 8.4.2021 – SlidesYT
  • OOP continues, inheritance, virtual methods, overriding, abstract classes
  • PRG2 – 2021 – 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 – 2021 – 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 05 – DFS, BFS, Visitor pattern

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

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

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

Lab 03 – Open Consultations 1

  • 18.3.2021
  • Q&A session!
  • Send me your questions via email no later than Wednesday 23:59!
  • I will sort them and then we go through them one by one in live session!

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

  • 11.3.2021 – Slides
  • PRG2 – 2021 – 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 – 2021 – 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)

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

  • 4.3.2021 – Slides
  • PRG2 – 2021 – 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

Level 00 – C# Crash Course

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