Question: 5.2 Answer the following: 5.2.1 You are given a task to develop a system for an enemy-fruit game by your manager. The game has three
5.2 Answer the following: 5.2.1 You are given a task to develop a system for an enemy-fruit game by your manager. The game has three main components, player, enemies, and fruits. If the player encounters an enemy it moves to the initial state, which is also the final state of this game. Every time a player gains a fruit the player starts walking. The player continues walking if gains a fruit except if there are four consecutive fruits, the player then jumps. If the fruits are more than four, the player walks and jumps alternatively. If anytime an enemy is encountered, it moves to the start state. Consider this situation and construct a DFA representing this game with formal definition of your construction. (10 marks) 5.2.2 If the DFA is possible, rename the states at your convenience, you may use e for the enemy and f for the fruit and give the regular expression for your construction with steps. (12 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
