|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "metadata": {}, |
| 6 | + "source": [ |
| 7 | + "<svg width=\"650\" height=\"212\" viewBox=\"0 0 1300 424\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n", |
| 8 | + "<path d=\"M697.088 148.4C644.229 149.248 598.72 193.91 595.328 247.616C592.219 301.606 635.184 349.659 691.152 355.312C747.403 360.966 792.912 316.304 792.912 256.096C792.912 195.606 749.947 147.552 697.088 148.4ZM734.965 260.054C732.704 288.038 715.179 303.302 703.589 304.432C674.475 307.824 649.6 281.536 651.296 247.899C652.992 214.262 666.56 193.344 693.979 192.779C721.397 192.214 738.075 223.59 734.965 260.054Z\" fill=\"#903DC3\"/>\n", |
| 9 | + "<path d=\"M904.848 153.77C851.989 152.922 809.024 200.976 809.024 261.466C809.024 321.957 854.533 366.336 910.784 360.682C967.035 355.029 1010 306.976 1006.61 252.986C1003.5 199.28 957.989 154.901 904.848 153.77ZM898.347 310.085C886.757 308.672 869.515 293.408 866.971 265.706C863.861 229.242 880.539 197.866 907.957 198.432C935.376 198.997 948.944 219.914 950.64 253.552C952.336 286.906 927.461 313.477 898.347 310.085Z\" fill=\"#903DC3\"/>\n", |
| 10 | + "<path d=\"M469.259 139.072L468.128 0L412.16 14.6987L421.205 358.421L476.325 360.4L473.216 182.885C485.371 177.515 525.227 166.491 526.64 210.304L532.011 272.773L535.685 360.683H593.349L571.584 208.891C562.821 120.133 530.315 119.851 469.259 139.072Z\" fill=\"#903DC3\"/>\n", |
| 11 | + "<path d=\"M1229.63 362.379L1213.52 400.257L1248.01 424.001L1281.93 403.931L1267.51 362.379H1229.63Z\" fill=\"#903DC3\"/>\n", |
| 12 | + "<path d=\"M1083.21 55.4024L1039.4 37.3118V128.048L990.496 126.352L999.824 190.8H1039.4L1042.22 344.288C1042.22 344.288 1036.01 399.408 1120.24 386.97C1120.24 386.97 1146.53 379.056 1145.68 360.682V300.192C1145.68 300.192 1127.87 310.65 1108.65 310.65C1089.43 310.65 1089.15 301.322 1089.15 301.322L1084.06 182.602L1145.4 179.21V139.92L1082.36 135.68L1083.21 55.4024Z\" fill=\"#903DC3\"/>\n", |
| 13 | + "<path d=\"M1299.73 55.9679L1183.84 33.9199L1255.07 340.613L1299.73 55.9679Z\" fill=\"#903DC3\"/>\n", |
| 14 | + "<path d=\"M275.349 141.05L290.613 181.189C328.773 158.293 350.256 181.189 350.256 181.189L349.973 206.912C236.341 226.981 265.173 332.133 265.173 332.133C276.763 373.402 314.075 371.989 314.075 371.989H399.157L400.853 180.624C387.568 91.5837 275.349 141.05 275.349 141.05ZM349.973 335.242C349.973 335.242 308.704 345.136 304.181 304.997C304.181 304.997 305.029 242.81 351.387 249.594L349.973 335.242Z\" fill=\"#903DC3\"/>\n", |
| 15 | + "<path d=\"M39 385.5L0 93L51.5 70.5L67.5 305.5L135 194.5L177 292.5L206 37.5L275 23L216.5 385.5L183.5 388.5L120.5 305.5L80 388.5L39 385.5Z\" fill=\"#903DC3\"/>\n", |
| 16 | + "</svg>\n" |
| 17 | + ] |
| 18 | + }, |
| 19 | + { |
| 20 | + "cell_type": "markdown", |
| 21 | + "metadata": {}, |
| 22 | + "source": [ |
| 23 | + "## **The xSoc Python Course Project**\n", |
| 24 | + "#### *Created by Tomas ([Warwick AI]()) and Keegan ([Computing](https://go.uwcs.uk/links))*" |
| 25 | + ] |
| 26 | + }, |
| 27 | + { |
| 28 | + "cell_type": "markdown", |
| 29 | + "metadata": {}, |
| 30 | + "source": [ |
| 31 | + "## Wahoot Project: Efficiency and Readability" |
| 32 | + ] |
| 33 | + }, |
| 34 | + { |
| 35 | + "cell_type": "markdown", |
| 36 | + "metadata": {}, |
| 37 | + "source": [ |
| 38 | + "We decided last minute that getting you to implement the whole of a back-end for a quiz app was a bit much for a *beginner* course, so to help out we've taken the liberty of writing the last class, `game.py`. Go ahead, take a look!" |
| 39 | + ] |
| 40 | + }, |
| 41 | + { |
| 42 | + "cell_type": "markdown", |
| 43 | + "metadata": {}, |
| 44 | + "source": [ |
| 45 | + "Unfortunately, we didn't have time to make it, you know, *readable*.\n", |
| 46 | + "\n", |
| 47 | + "This week, we want you to make it so people can actually read what we've written. Also, in our tired state, some of the functions aren't as efficient as they could be, so you'll rewrite them so Wahoot doesn't suffer too many delays. Use the Week 6 notebook for ideas to make the code more readable." |
| 48 | + ] |
| 49 | + }, |
| 50 | + { |
| 51 | + "cell_type": "markdown", |
| 52 | + "metadata": {}, |
| 53 | + "source": [ |
| 54 | + "> Task 1: First things first, we'll tackle `num_questions()` and `num_players()`.\n", |
| 55 | + ">\n", |
| 56 | + "> For `num_questions()`, readability is the issue. It's not really clear what `q` and `c` actually are, so change the variable names to be something a bit more descriptive.\n", |
| 57 | + ">\n", |
| 58 | + "> `num_players()` has the same issue, but there's also a better way to go about counting the number of players than the way we're using." |
| 59 | + ] |
| 60 | + }, |
| 61 | + { |
| 62 | + "cell_type": "markdown", |
| 63 | + "metadata": {}, |
| 64 | + "source": [ |
| 65 | + "> Task 2: Take a look at `on_question_answer()` and `has_player_finished()`. They've got similar issues to the methods you've just fixed.\n", |
| 66 | + ">\n", |
| 67 | + "> Rewrite the methods so they're more readable and efficient" |
| 68 | + ] |
| 69 | + }, |
| 70 | + { |
| 71 | + "cell_type": "markdown", |
| 72 | + "metadata": {}, |
| 73 | + "source": [ |
| 74 | + "> Task 3: the `get_leaderboard()` method sorts the current list of players in ascending order of score and returns the array.\n", |
| 75 | + ">\n", |
| 76 | + "> Task 3a: Fix the readability issues.\n", |
| 77 | + ">\n", |
| 78 | + "> Task 3b: Currently, we aren't using the best sorting algorithm. If only Python had a better way to sort things..." |
| 79 | + ] |
| 80 | + }, |
| 81 | + { |
| 82 | + "cell_type": "markdown", |
| 83 | + "metadata": {}, |
| 84 | + "source": [ |
| 85 | + "# Bonus task\n", |
| 86 | + "\n", |
| 87 | + "How about implementing your own sorting algorithm?" |
| 88 | + ] |
| 89 | + }, |
| 90 | + { |
| 91 | + "cell_type": "markdown", |
| 92 | + "metadata": {}, |
| 93 | + "source": [ |
| 94 | + "🖋️ ***Written by Alia from the [Computing Society](https://go.uwcs.uk/links)***" |
| 95 | + ] |
| 96 | + } |
| 97 | + ], |
| 98 | + "metadata": { |
| 99 | + "kernelspec": { |
| 100 | + "display_name": "Python 3.10.8 64-bit", |
| 101 | + "language": "python", |
| 102 | + "name": "python3" |
| 103 | + }, |
| 104 | + "language_info": { |
| 105 | + "name": "python", |
| 106 | + "version": "3.10.8" |
| 107 | + }, |
| 108 | + "orig_nbformat": 4, |
| 109 | + "vscode": { |
| 110 | + "interpreter": { |
| 111 | + "hash": "b852fe1f214fe6a0387799bd52159c64dfd73c3955c21916f0ce4da0f34f6d48" |
| 112 | + } |
| 113 | + } |
| 114 | + }, |
| 115 | + "nbformat": 4, |
| 116 | + "nbformat_minor": 2 |
| 117 | +} |
0 commit comments