This preview shows page 1. Sign up to view the full content.
Unformatted text preview: n vec itself, i.e. the vector represented by vec should be transformed by the matrix mat. void matrixMul(float res, float mat1, float mat2, int
m, int n, int p); This function should take in a matrix mat1 with m rows and n columns, and a matrix mat2 with n rows and p columns, and should multiply the two. The result should be stored in res, which is an array that represents a matrix with m rows and p columns. Task 7 – Simple Games There are two games you will be implementing in this task, which are essentially variants of each other. This game is played on a square board, and each square has a switch on it. Initially, all the switches are turned “off”. The player is given a stamp, and then he starts stamping on the board. Every square the stamp touches has its state toggled. If it was off before, it will become on, and if it was on before, it will become off. The stamp might have an irregular shape, which will affect which stamps will be turned on and which will be turned off. The two functions below have identical arguments. The arr is a boolean array that has length nxn. This represents the game board in the same way a matrix is represented as a 1D array. The turnR and turnC are int arrays that represent the row and column locations at...
View
Full
Document
This homework help was uploaded on 03/02/2014 for the course CS 200 taught by Professor Fareedzaffar during the Winter '11 term at Lahore University of Management Sciences.
 Winter '11
 FareedZaffar

Click to edit the document details