Question: in rust full code with the crate and dependies For this exercise the student must first define the transition diagram and draw a finite state

in rust full code with the crate and dependies

For this exercise the student must first define the transition diagram and draw a finite state machine for a game character with at least the following states: laying, sitting, standing, walking, running, jumping, falling, dead, where dead is a final state. The inputs are the arrow keys, or the characters {h,j,k,l} which represent {left, down, up, right}. All states must be reachable using the input language.

Explain your choices of transitions.

Implement your finite state machine in Rust, and include a main program which allows the user to input a string in the language of the state machine. The program should with each transition display a representation of the character in the state. If the string is accepted, complete a final display and exit.

(hint: infinite loop -> read input, perform action(s), display)

Design a second state machine which maintains the direction the character if facing. Include the design in your report.

Implement the second state machine into your code. Include with the display of the representation of the character an indication of the direction of the character.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!