Question
write a single player candy crush code in C++. A 2D grid should be used for candies storage and the minimum size of grid has
write a single player candy crush code in C++. A 2D grid should be used for candies storage and the minimum size of grid has to be 9x9. it should be a console based game. at the start of the game the whole grid will be filled with new candies randomly. the user must be provided with swaping operation so that he can swap 2 candies. the target goal points and number of moves should be set at the start. use characters instead of candies.
jelly bean=30 points
yellow lemon=30 point
gumsqure=40 point
blue= 50 points
orange=60 point
keep to the code very basic, simple syntax of c++.
the game should be Console based and no styling or colour or graphics should be used
eu Delow. Plain Candies Points gained when crushed 30 Points Red - Jelly Bean 30 Points Yellow - Lemon Drop 40 Points Green - Gum Square 50 Points Blue - Lollipop Head 60 Points Orange - Lozenge Special Candies Color Bomb Game Rules: 1. Crush Plain Candies: When three similar candies lie in the same column, or row of grid, they will get crushed and empty slots of grid will be refilled with new candies by shifting candies from top towards bottom. 2. Striped Candy: It is created when 4 similar plain candies lie in the same column, or row of grid. Striped candy can be made with 5 different colors Blue, Green, Orange, Red and Yellow. 3. Wrapped Candy: It is created by matching 5 candies of the same color in L or T shape. Wrapped candy can be made with 5 different colors Blue, Green, Orange, Red and Yellow. OR 3 4. Color Bomb: It is created by matching 5 candies of same color in row or column. OR cc.- 5. Plain Candy + Striped Candy: When 3 similar color candies lie in the same column, or row of grid, they will be crushed. If any of them is a striped candy then the corresponding rows or columns, which contain the striped candies, will be cleared. The decision to clear the row or column will be made according to the direction of stripes on candy. 6. Plain Candy + Wrapped candy: When 3 similar color candies lie in the same column, or row of grid, they will be crushed. If any of them is a wrapped candy then the candies in (3 x 3) square area of the board around the wrapped candy will also be crushed. 7. Color Bomb + Plain Candy: If player swaps color bomb with any plain candy then all candies, of that particular color, will be crushed. 8. Color Bomb + Color Bomb: If player swaps color bomb with another color bomb, then all candies from board will be crushed and board will be reloaded with all new candies. Concepts Needed Basic data types CStrings, character arrays Multi-dimensional Arrays Functions Operations on Arrays: Array iteration, array search (covered in lab), counting in arrays Passing Multidimensional arrays into functions, understanding the pass-by-reference concept in arrays File I/O eu Delow. Plain Candies Points gained when crushed 30 Points Red - Jelly Bean 30 Points Yellow - Lemon Drop 40 Points Green - Gum SquareStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started