Tag: 2D Array

Shuffling a 2D Array

shuffling-2d-array

For this challenge we will investigate how to create a 2D array to store the value from 1 to 100 in a 10×10 array. We will then write an algorithm to shuffle the content of this array. See the code

Boggle Challenge

boggle

Boggle is a word game based on a 4×4 grid of 16 letters. Each time the game is played a new grid is generated. In the real game this is done by shaking a cube that contains 16 letter dice.

My Weekly Timetable

timetable

A school timetable is displayed as a 2D table consisting of 5 rows (for each day of the week) and 5 columns (number of lessons in a day). Such a table can be stored in a computer program using a

Four-in-a-row challenge!

Connect4 Data Structure using a 2D-array

In this blog post you will use Python Code to complete this simulation of the game of connect 4. (Rules of the game) You will first need to reverse-engineer the code provided. The code so far is used to: Display

Space Invaders – 3D Pixel Art

space-invaders-pixel-art

In this blog post we will use Glowscript to create a 3D animation of a space invader. 2D Graphics used in retro arcade games consist of pixels. A 2D graphic can be described as a grid of pixels of different

Cinema Booking Challenge

A cinema has created a booking system for their main theatre which consists of 48 seats, organised in 6 rows of 8 seats. To store information as to whether a seat is booked or available, the program uses a 2-dimensional

Battleship Challenge

Battleship Grid Initialisation Algorithm

For this challenge we are not going to recreate a full battleship game. Instead we are going to focus on randomly placing the ships on the grid using an algorithm. The code given below uses Python Turtle to draw the