2D Array - 101 Computing https://www.101computing.net Boost Your Programming Skills! Fri, 31 Jan 2025 10:17:05 +0000 en-US hourly 1 https://www.101computing.net/wp/wp-content/uploads/cropped-android-chrome-512x512-1-32x32.png 2D Array - 101 Computing https://www.101computing.net 32 32 Pacman – Pac-dots Randomiser https://www.101computing.net/pac-dots-randomiser/ Fri, 16 Feb 2024 14:06:58 +0000 https://www.101computing.net/?p=19705 In this challenge, we are looking at using a 2D Array to create the maze used in a Pacman Game. Our 2D array will contains different numerical values to represents the corridors, walls and the pac-dots: So in our 2D-array

The post Pacman – Pac-dots Randomiser first appeared on 101 Computing.

]]>
Laser Maze Game in Python https://www.101computing.net/laser-maze-game-in-python/ Mon, 05 Dec 2022 12:36:49 +0000 https://www.101computing.net/?p=16769 In this Python programming challenge, we are going to recreate the game “Laser Maze”. The aim is to redirect a laser beam across a given stage in order to reach the exit gate of the stage. The laser can only

The post Laser Maze Game in Python first appeared on 101 Computing.

]]>
A Python game of Noughts and Crosses https://www.101computing.net/a-python-game-of-noughts-and-crosses/ Tue, 08 Nov 2022 23:00:28 +0000 https://www.101computing.net/?p=16255 In this blog post, we will focus on using a 2D array to create a 3×3 game of noughts and crosses. We will investigate the code using a step by step approach. You can follow the steps described below and

The post A Python game of Noughts and Crosses first appeared on 101 Computing.

]]>
2D Dice Grid Scoring Algorithm https://www.101computing.net/2d-dice-grid-scoring-algorithm/ Tue, 24 Aug 2021 16:51:16 +0000 https://www.101computing.net/?p=12694 This challenge is based on a 4×4 grid of dice (16 dice in total). Each game starts by shaking the grid to generate a new grid of 16 values. All dice are 6-sided dice, generating random values between 1 and

The post 2D Dice Grid Scoring Algorithm first appeared on 101 Computing.

]]>
Diagonal Difference Calculator https://www.101computing.net/diagonal-difference-calculator/ Wed, 18 Aug 2021 10:01:14 +0000 https://www.101computing.net/?p=12682 Let’s consider a square matrix of n x n. (n columns and n rows). The diagonal difference of a square matrix is the absolute difference between the sums of its diagonal. Let’s look at an example based on the following

The post Diagonal Difference Calculator first appeared on 101 Computing.

]]>
Level generation using a 2D array https://www.101computing.net/level-generation-using-a-2d-array/ Mon, 16 Dec 2019 22:53:26 +0000 https://www.101computing.net/?p=9847 In this post we will investigate how to generate a level/stage for a platform game using a 2D array. We will focus on the level for a 2D platform game such as Super Mario: By applying a grid layout to

The post Level generation using a 2D array first appeared on 101 Computing.

]]>
Shuffling a 2D Array https://www.101computing.net/shuffling-a-2d-array/ Thu, 07 Nov 2019 22:35:23 +0000 https://www.101computing.net/?p=9631 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

The post Shuffling a 2D Array first appeared on 101 Computing.

]]>
Boggle Challenge https://www.101computing.net/boggle-challenge/ Mon, 04 Nov 2019 19:49:08 +0000 https://www.101computing.net/?p=9595 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.

The post Boggle Challenge first appeared on 101 Computing.

]]>
My Weekly Timetable https://www.101computing.net/my-weekly-timetable/ Thu, 04 Apr 2019 15:03:36 +0000 https://www.101computing.net/?p=8673 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

The post My Weekly Timetable first appeared on 101 Computing.

]]>
Four-in-a-row challenge! https://www.101computing.net/four-in-a-row-challenge/ Mon, 21 May 2018 09:07:17 +0000 http://www.101computing.net/?p=6884 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

The post Four-in-a-row challenge! first appeared on 101 Computing.

]]>