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;
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");
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.