Skip to main content

CIS 371

CSS and HTML

Fall 2022

GitHub Classroom URL: https://classroom.github.com/a/6842nxMV

Objective

The objective of this series of assignments is to provide students with practice writing HTML and CSS.

This video provides an overview of the version of Qwixx you will be implementing. (The video demonstrates a Java version of the game for CIS 163. You'll be implementing a similar game in JavaScript.) This video walks through the official, multi-player rules for Qwixx.

Part 1: Qwixx Board

Implement the board for the "pencil game" Qwixx.

This assignment must be completed individually. You may not share code; but, you are encouraged to share high-level ideas with each other including:

Hints:

Qwixx board

Part 2: Qwixx using a template

Use an HTML templating system to generate the Quixx board.

21 x 6 Quixx board

Part 3: Implement the game

GitHub classroom link: https://classroom.github.com/a/iuLdpQXI.

Add JavaScript to your Qwixx board so that you can play the game. You can find the rules here: https://gamewright.com/pdfs/Rules/QwixxTM-RULES.pdf

Rules:

Ideas / Suggestions:

Setting up Jest

To run your Qwixx code directly in a browser, you will want to use the ES 6 module import syntax. This ES6 syntax is different from the CommonJS syntax used by Node, which causes problems when testing. To address the differing import syntax, we will use a package called Babel to transform the code into something that Node handles. To set up Jest using Babel:

  1. Set up npm in your project: npm init -y
  2. Install Jest: npm install --save-dev jest
  3. Install Babel: npm install --save-dev babel-jest @babel/core @babel/preset-env
  4. Configure Babel by creating a file named babel.config.js with the following content:
    module.exports = {
      presets: [
        [
          '@babel/preset-env',
          {
            targets: {
              node: 'current',
            },
          },
        ],
      ],
    };
    
  5. Edit the "scripts"/"test" property to equal jest

You can now run your Jest tests from the command line with npm test.

Note: If you choose to use the starter code from GitHub classroom, these steps have already been completed. You need only run npm install.)

Submission

I will grade the parts of this assignment separately.


Updated Wednesday, 19 October 2022, 7:31 PM

W3c Validation