Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PLS implement this function typedef enum type { ATTACK, DEFEND, HEAL } decisionT

ID: 3765422 • Letter: P

Question

PLS implement this function

typedef enum type
{
ATTACK,
DEFEND,
HEAL
} decisionType;

typedef struct bossDecision_
{
decisionType type;
struct bossDecision_* next;
} bossDecision;

typedef struct bossDecisionNode_
{
struct bossDecisionNode_* leftNode;
struct bossDecisionNode_* rightNode;
int healthMin;
int healthMax;
bossDecision* topOfStack;
} bossDecisionNode;

typedef struct shield
{
char name[50];
int price;
int defense;
int weight;
} Shield;

typedef struct sword
{
char name[50];
int price;
int damage;
} Sword;

typedef struct hero
{
char name[30];
int health;
int maxHealth;
int defense;
int speed;
int attack;
int luck;
decisionType decision;
Shield* shield;
Sword* sword;
//can only heal fully once, so false means hero heals for a fraction
bool hasHealed;
} Hero;

typedef struct boss
{
char name[30];
int health;
int maxHealth;
int defense;
int speed;
int attack;
int luck;
bossDecisionNode* root;
decisionType nextAction;
} Boss;

typedef struct players
{
Hero* hero;
Boss* boss;
struct players* next;
} Player;

We need to know the order of who takes their action first each turn, so we need to queue each player up so we can this order. Create a queue of these players, with the actor having the fastest speed being dequeued first.

Explanation / Answer

#include<stdio.h>

#define plyer

int queue_array[player];

int hero;

int boss;

main()

{

int p;

while(1)

{

scanf(%d,"p");

switch(p)

{

case 1:

insert();

brealk;

case 2:

delete()

break;

case 3:

display();

break;

}

insert()

{

int actor;

if(boss==player-1)

printf("boss");

else

{

if(hero ==-1)

{

   hero=0;

printf("number of player");

scanf("%",&no player);

boss= hero;

queue_array[boss]=plyer;

}

display()

{

   int i;

if(boss==-1)

{

printf("player is none");

else

{

printf("player is");

for(i=hero;i<=boss;i++)

{

printf("queu_array");

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote