feat: Initial commit
This commit is contained in:
103
Laboratorio 7/Esercizio 1/equipArray.c
Normal file
103
Laboratorio 7/Esercizio 1/equipArray.c
Normal file
@@ -0,0 +1,103 @@
|
||||
// Laboratorio 7 - Esercizio 1 - equipArray.c
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#ifndef EQUIPARRAY_C_DEFINED
|
||||
#define EQUIPARRAY_C_DEFINED
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "invArray.h"
|
||||
#include "equipArray.h"
|
||||
|
||||
/* ADT di prima classe collezione di oggetti di equipaggiamento */
|
||||
typedef struct equipArray_s {
|
||||
int inUse;
|
||||
int items[EQUIP_SLOT];
|
||||
} *equipArray_t;
|
||||
|
||||
/* creatore e disruttore */
|
||||
equipArray_t equipArray_init() {
|
||||
equipArray_t new = malloc(sizeof(struct equipArray_s));
|
||||
new->inUse = 0;
|
||||
return new;
|
||||
}
|
||||
void equipArray_free(equipArray_t equipArray) {
|
||||
free(equipArray);
|
||||
}
|
||||
|
||||
/* quanti equipaggiamenti sono in uso */
|
||||
int equipArray_inUse(equipArray_t equipArray) {
|
||||
return equipArray->inUse;
|
||||
}
|
||||
|
||||
int equipArray_getEquipByIndex(equipArray_t equipArray, int index) {
|
||||
return equipArray->items[index];
|
||||
}
|
||||
|
||||
/* scrittura su file */
|
||||
void equipArray_print(FILE *fp, equipArray_t equipArray, invArray_t invArray) {
|
||||
for (int i = 0; i < equipArray->inUse; i++) {
|
||||
printf(" %d: ", i);
|
||||
invArray_printByIndex(fp, invArray, equipArray->items[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void equipArray_insert(equipArray_t equipArray, invArray_t invArray) {
|
||||
char name[LEN+1];
|
||||
|
||||
if (equipArray->inUse >= EQUIP_SLOT) {
|
||||
puts("Tutti gli slot sono occupati");
|
||||
return;
|
||||
}
|
||||
|
||||
puts("Inserisci il nome dell'oggetto da equipaggiare: ");
|
||||
scanf(" %50s", name);
|
||||
int index = invArray_searchByName(invArray, name);
|
||||
|
||||
if (index == -1) {
|
||||
puts("Oggetto non trovato");
|
||||
return;
|
||||
}
|
||||
|
||||
equipArray->items[(equipArray->inUse)++] = index;
|
||||
}
|
||||
|
||||
void equipArray_remove(equipArray_t equipArray, invArray_t invArray) {
|
||||
int index;
|
||||
|
||||
if (equipArray->inUse <= 0) {
|
||||
puts("Tutti gli slot sono vuoti");
|
||||
return;
|
||||
}
|
||||
|
||||
puts("Oggetti equipaggiati: ");
|
||||
equipArray_print(stdout, equipArray, invArray);
|
||||
|
||||
puts("Inserisci l'indice dell'oggetto da rimuovere: ");
|
||||
scanf(" %d", &index);
|
||||
if (index < 0 || index >= equipArray->inUse) {
|
||||
puts("Indice oggetto non valido");
|
||||
return;
|
||||
}
|
||||
|
||||
equipArray->items[index] = equipArray->items[--(equipArray->inUse)];
|
||||
}
|
||||
|
||||
/* modifica equipaggiamento scegliendo un oggetto da inventario */
|
||||
void equipArray_update(equipArray_t equipArray, invArray_t invArray) {
|
||||
char selection;
|
||||
puts("Vuoi inserire o rimuovere un oggetto? Rispondi (i) o (r): ");
|
||||
scanf(" %c", &selection);
|
||||
|
||||
if (selection == 'i') {
|
||||
equipArray_insert(equipArray, invArray);
|
||||
} else {
|
||||
equipArray_remove(equipArray, invArray);
|
||||
}
|
||||
}
|
||||
|
||||
/* Si possono aggiungere altre funzioni se ritenute necessarie */
|
||||
|
||||
#endif
|
||||
33
Laboratorio 7/Esercizio 1/equipArray.h
Normal file
33
Laboratorio 7/Esercizio 1/equipArray.h
Normal file
@@ -0,0 +1,33 @@
|
||||
// Laboratorio 7 - Esercizio 1 - equipArray.h
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#ifndef EQUIPARRAY_H_DEFINED
|
||||
#define EQUIPARRAY_H_DEFINED
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define EQUIP_SLOT 8
|
||||
|
||||
#include "invArray.h"
|
||||
|
||||
/* ADT di prima classe collezione di oggetti di equipaggiamento */
|
||||
typedef struct equipArray_s *equipArray_t;
|
||||
|
||||
/* creatore e disruttore */
|
||||
equipArray_t equipArray_init();
|
||||
void equipArray_free(equipArray_t equipArray);
|
||||
|
||||
/* quanti equipaggiamenti sono in uso */
|
||||
int equipArray_inUse(equipArray_t equipArray);
|
||||
|
||||
/* scrittura su file */
|
||||
void equipArray_print(FILE *fp, equipArray_t equipArray, invArray_t invArray);
|
||||
/* modifica equipaggiamento scegliendo un oggetto da inventario */
|
||||
void equipArray_update(equipArray_t equipArray, invArray_t invArray);
|
||||
int equipArray_getEquipByIndex(equipArray_t equipArray, int index);
|
||||
|
||||
/* Si possono aggiungere altre funzioni se ritenute necessarie */
|
||||
|
||||
#endif
|
||||
122
Laboratorio 7/Esercizio 1/gdr.c
Normal file
122
Laboratorio 7/Esercizio 1/gdr.c
Normal file
@@ -0,0 +1,122 @@
|
||||
// Laboratorio 7 - Esercizio 1 - gdr.c
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "pgList.h"
|
||||
#include "invArray.h"
|
||||
#include "pg.h"
|
||||
|
||||
#define N_SCELTE 7
|
||||
#define DBG 0
|
||||
|
||||
enum { falso, vero };
|
||||
typedef int bool;
|
||||
|
||||
void stampaMenu(char *scelte[], int *selezione){
|
||||
int i=0;
|
||||
printf("\nMENU'\n");
|
||||
for(i=0;i<N_SCELTE;i++)
|
||||
printf("%2d > %s\n",i,scelte[i]);
|
||||
scanf(" %d",selezione);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char *scelte[] = {
|
||||
"Uscita",
|
||||
"Stampa personaggi",
|
||||
"Stampa inventario",
|
||||
"Cerca personaggio",
|
||||
"Aggiungi personaggio",
|
||||
"Elimina personaggio",
|
||||
"Modifica equip"
|
||||
};
|
||||
|
||||
char codiceRicerca[LEN];
|
||||
int selezione;
|
||||
FILE *fin;
|
||||
bool fineProgramma;
|
||||
|
||||
pgList_t pgList = pgList_init();
|
||||
invArray_t invArray = invArray_init();
|
||||
pg_t *pgp, pg;
|
||||
|
||||
fin = fopen("pg.txt","r");
|
||||
pgList_read(fin, pgList);
|
||||
fclose(fin);
|
||||
#if DBG
|
||||
pgList_print(stdout, pgList);
|
||||
#endif /* DBG */
|
||||
|
||||
fin = fopen("inventario.txt","r");
|
||||
invArray_read(fin, invArray);
|
||||
fclose(fin);
|
||||
#if DBG
|
||||
invArray_print(stdout, invArray);
|
||||
#endif /* DBG */
|
||||
|
||||
fineProgramma = falso;
|
||||
|
||||
do {
|
||||
stampaMenu(scelte, &selezione);
|
||||
switch(selezione){
|
||||
|
||||
case 0: {
|
||||
fineProgramma = vero;
|
||||
} break;
|
||||
|
||||
case 1: {
|
||||
pgList_print(stdout, pgList, invArray);
|
||||
} break;
|
||||
|
||||
case 2: {
|
||||
invArray_print(stdout, invArray);
|
||||
} break;
|
||||
|
||||
case 3: {
|
||||
printf("Inserire codice personaggio: ");
|
||||
scanf("%s", codiceRicerca);
|
||||
pgp = pgList_searchByCode(pgList, codiceRicerca);
|
||||
if (pgp!=NULL) {
|
||||
pg_print(stdout, pgp, invArray);
|
||||
} else {
|
||||
puts("Personaggio non trovato");
|
||||
}
|
||||
} break;
|
||||
|
||||
case 4: {
|
||||
printf("Cod Nome Classe HP MP ATK DEF MAG SPR: ");
|
||||
if (pg_read(stdin, &pg) != 0) {
|
||||
pgList_insert(pgList, pg);
|
||||
}
|
||||
} break;
|
||||
|
||||
case 5: {
|
||||
printf("Inserire codice personaggio: ");
|
||||
scanf("%s", codiceRicerca);
|
||||
pgList_remove(pgList, codiceRicerca);
|
||||
} break;
|
||||
|
||||
case 6: {
|
||||
printf("Inserire codice personaggio: ");
|
||||
scanf("%s", codiceRicerca);
|
||||
pgp = pgList_searchByCode(pgList, codiceRicerca);
|
||||
if (pgp!=NULL) {
|
||||
pg_updateEquip(pgp, invArray);
|
||||
} else {
|
||||
puts("Personaggio non trovato");
|
||||
}
|
||||
} break;
|
||||
|
||||
default:{
|
||||
printf("Scelta non valida\n");
|
||||
} break;
|
||||
}
|
||||
} while(!fineProgramma);
|
||||
|
||||
pgList_free(pgList);
|
||||
|
||||
return 0;
|
||||
}
|
||||
71
Laboratorio 7/Esercizio 1/inv.c
Normal file
71
Laboratorio 7/Esercizio 1/inv.c
Normal file
@@ -0,0 +1,71 @@
|
||||
// Laboratorio 7 - Esercizio 1 - inv.c
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#ifndef INV_C_DEFINED
|
||||
#define INV_C_DEFINED
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <limits.h>
|
||||
#include "inv.h"
|
||||
|
||||
/* funzioni di input/output delle statistiche */
|
||||
void stat_read(FILE *fp, stat_t *statp) {
|
||||
fscanf(fp, " %d %d %d %d %d %d", &(statp->hp), &(statp->mp), &(statp->atk), &(statp->def), &(statp->mag), &(statp->spr));
|
||||
}
|
||||
|
||||
int zero_se_soglia(int a, int soglia) {
|
||||
if (a < soglia)
|
||||
return 0;
|
||||
return a;
|
||||
}
|
||||
|
||||
void stat_print(FILE *fp, stat_t *statp, int soglia) {
|
||||
fprintf(fp, "HP: %d, MP: %d, ATK: %d, DEF: %d, MAG: %d, SPR: %d\n",
|
||||
zero_se_soglia(statp->hp, soglia),
|
||||
zero_se_soglia(statp->mp, soglia),
|
||||
zero_se_soglia(statp->atk, soglia),
|
||||
zero_se_soglia(statp->def, soglia),
|
||||
zero_se_soglia(statp->mag, soglia),
|
||||
zero_se_soglia(statp->spr, soglia));
|
||||
}
|
||||
|
||||
void stat_copy(stat_t *a, stat_t *b) {
|
||||
a->atk = b->atk;
|
||||
a->def = b->def;
|
||||
a->hp = b->hp;
|
||||
a->mag = b->mag;
|
||||
a->mp = b->mp;
|
||||
a->spr = b->spr;
|
||||
}
|
||||
|
||||
void stat_sum(stat_t *a, stat_t *b) {
|
||||
a->atk += b->atk;
|
||||
a->def += b->def;
|
||||
a->hp += b->hp;
|
||||
a->mag += b->mag;
|
||||
a->mp += b->mp;
|
||||
a->spr += b->spr;
|
||||
}
|
||||
|
||||
/* funzioni di input/output di un oggetto dell'inventario */
|
||||
void inv_read(FILE *fp, inv_t *invp) {
|
||||
fscanf(fp, " %49s %49s", invp->nome, invp->tipo);
|
||||
stat_read(fp, &(invp->stat));
|
||||
}
|
||||
|
||||
void inv_print(FILE *fp, inv_t *invp) {
|
||||
fprintf(fp, " %s (%s) - ", invp->nome, invp->tipo);
|
||||
stat_print(fp, &(invp->stat),INT_MIN);
|
||||
}
|
||||
|
||||
/* ritorna il campo stat di un oggetto dell'inventario */
|
||||
stat_t inv_getStat(inv_t *invp) {
|
||||
return invp->stat;
|
||||
}
|
||||
|
||||
/* Si possono aggiungere altre funzioni se ritenute necessarie */
|
||||
|
||||
#endif
|
||||
42
Laboratorio 7/Esercizio 1/inv.h
Normal file
42
Laboratorio 7/Esercizio 1/inv.h
Normal file
@@ -0,0 +1,42 @@
|
||||
// Laboratorio 7 - Esercizio 1 - inv.h
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#ifndef INV_H_DEFINED
|
||||
#define INV_H_DEFINED
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define LEN 50
|
||||
#define MIN_STAT 1
|
||||
|
||||
/* quasi ADT statistiche */
|
||||
typedef struct stat_s {
|
||||
int hp, mp, atk, def, mag, spr;
|
||||
} stat_t;
|
||||
|
||||
/* quasi ADT oggetto di inventario */
|
||||
typedef struct inv_s {
|
||||
char nome[LEN];
|
||||
char tipo[LEN];
|
||||
stat_t stat;
|
||||
} inv_t;
|
||||
|
||||
/* funzioni di input/output delle statistiche */
|
||||
void stat_read(FILE *fp, stat_t *statp);
|
||||
void stat_print(FILE *fp, stat_t *statp, int soglia);
|
||||
|
||||
void stat_copy(stat_t *a, stat_t *b);
|
||||
void stat_sum(stat_t *a, stat_t *b);
|
||||
|
||||
/* funzioni di input/output di un oggetto dell'inventario */
|
||||
void inv_read(FILE *fp, inv_t *invp);
|
||||
void inv_print(FILE *fp, inv_t *invp);
|
||||
|
||||
/* ritorna il campo stat di un oggetto dell'inventario */
|
||||
stat_t inv_getStat(inv_t *invp);
|
||||
|
||||
/* Si possono aggiungere altre funzioni se ritenute necessarie */
|
||||
|
||||
#endif
|
||||
75
Laboratorio 7/Esercizio 1/invArray.c
Normal file
75
Laboratorio 7/Esercizio 1/invArray.c
Normal file
@@ -0,0 +1,75 @@
|
||||
// Laboratorio 7 - Esercizio 1 - invArray.c
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#ifndef INVARRAY_C_DEFINED
|
||||
#define INVARRAY_C_DEFINED
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "inv.h"
|
||||
|
||||
typedef struct invArray_s {
|
||||
int N;
|
||||
inv_t *array;
|
||||
} *invArray_t;
|
||||
|
||||
/* creatore e disruttore */
|
||||
invArray_t invArray_init() {
|
||||
invArray_t new = malloc(sizeof(struct invArray_s));
|
||||
new->N = 0;
|
||||
new->array = NULL;
|
||||
return new;
|
||||
}
|
||||
|
||||
void invArray_free(invArray_t invArray) {
|
||||
free(invArray->array);
|
||||
free(invArray);
|
||||
}
|
||||
|
||||
/* lettura e scrittura su file */
|
||||
void invArray_read(FILE *fp, invArray_t invArray) {
|
||||
if (fscanf(fp, " %d", &invArray->N) != 1)
|
||||
return;
|
||||
|
||||
invArray->array = malloc(invArray->N * sizeof(inv_t));
|
||||
|
||||
for (int i = 0; i < invArray->N; i++) {
|
||||
inv_read(fp, &invArray->array[i]);
|
||||
}
|
||||
}
|
||||
void invArray_print(FILE *fp, invArray_t invArray) {
|
||||
for (int i = 0; i < invArray->N; i++) {
|
||||
inv_print(fp, &invArray->array[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void invArray_printByIndex(FILE *fp, invArray_t invArray, int index) {
|
||||
if (index >= invArray->N)
|
||||
return;
|
||||
|
||||
inv_print(fp, &invArray->array[index]);
|
||||
|
||||
}
|
||||
|
||||
/* ritorna puntatore a oggetto selezionato da indice (nel vettore) */
|
||||
inv_t *invArray_getByIndex(invArray_t invArray, int index) {
|
||||
if (index >= invArray->N)
|
||||
return NULL;
|
||||
|
||||
return &(invArray->array[index]);
|
||||
}
|
||||
/* ritorna indice (nel vettore) a oggetto selezionato da nome */
|
||||
int invArray_searchByName(invArray_t invArray, char *name) {
|
||||
for (int i = 0; i < invArray->N; i++) {
|
||||
if (!strcmp(invArray->array[i].nome, name))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Si possono aggiungere altre funzioni se ritenute necessarie */
|
||||
|
||||
#endif
|
||||
31
Laboratorio 7/Esercizio 1/invArray.h
Normal file
31
Laboratorio 7/Esercizio 1/invArray.h
Normal file
@@ -0,0 +1,31 @@
|
||||
// Laboratorio 7 - Esercizio 1 - invArray.h
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#ifndef INVARRAY_H_DEFINED
|
||||
#define INVARRAY_H_DEFINED
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "inv.h"
|
||||
|
||||
/* ADT di prima classe collezione di oggetti di inventario */
|
||||
typedef struct invArray_s *invArray_t;
|
||||
|
||||
/* creatore e disruttore */
|
||||
invArray_t invArray_init();
|
||||
void invArray_free(invArray_t invArray);
|
||||
|
||||
/* lettura e scrittura su file */
|
||||
void invArray_read(FILE *fp, invArray_t invArray);
|
||||
void invArray_print(FILE *fp, invArray_t invArray);
|
||||
/* ritorna puntatore a oggetto selezionato da indice (nel vettore) */
|
||||
void invArray_printByIndex(FILE *fp, invArray_t invArray, int index);
|
||||
inv_t *invArray_getByIndex(invArray_t invArray, int index);
|
||||
/* ritorna indice (nel vettore) a oggetto selezionato da nome */
|
||||
int invArray_searchByName(invArray_t invArray, char *name);
|
||||
|
||||
/* Si possono aggiungere altre funzioni se ritenute necessarie */
|
||||
|
||||
#endif
|
||||
16
Laboratorio 7/Esercizio 1/inventario.txt
Normal file
16
Laboratorio 7/Esercizio 1/inventario.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
15
|
||||
Excalibur Spada2M 0 0 120 0 0 50
|
||||
Filatterio Accessorio -100 20 -30 -30 25 25
|
||||
ArmillaDiDiamante Accessorio 0 0 25 0 25
|
||||
Escutcheon Scudo 1000 50 0 75 0 0
|
||||
MantoElfico Vesti 0 50 0 10 10 10
|
||||
Pendragon Scudo 250 0 0 45 0 30
|
||||
Oricalco Reliquia 0 0 0 0 15 15
|
||||
TalismanoNero Accessorio -500 150 0 0 100 50
|
||||
AmmazzaDraghi Spada2M 0 0 80 -20 0 -20
|
||||
Fiocco Accessorio 0 0 1 1 1 1
|
||||
CorazzaAdamantina ArmaturaPesante 3333 333 -15 33 -15 33
|
||||
DagaRunica Pugnale 0 50 10 0 35 0
|
||||
Tempesta Spada1M 0 0 40 0 -5 0
|
||||
Maximillian ArmaturaLeggera 500 0 0 30 0 15
|
||||
Ametista Reliquia 0 0 15 15 0 0
|
||||
58
Laboratorio 7/Esercizio 1/pg.c
Normal file
58
Laboratorio 7/Esercizio 1/pg.c
Normal file
@@ -0,0 +1,58 @@
|
||||
// Laboratorio 7 - Esercizio 1 - pg.c
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#ifndef PG_C_DEFINED
|
||||
#define PG_C_DEFINED
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "equipArray.h"
|
||||
#include "pg.h"
|
||||
|
||||
void pg_calc_stats(pg_t *pgp, invArray_t invArray)
|
||||
{
|
||||
stat_copy(&pgp->eq_stat, &pgp->b_stat);
|
||||
for (int i = 0; i < equipArray_inUse(pgp->equip); i++) {
|
||||
int index = equipArray_getEquipByIndex(pgp->equip, i);
|
||||
inv_t *item = invArray_getByIndex(invArray, index);
|
||||
stat_sum(&pgp->eq_stat, &item->stat);
|
||||
}
|
||||
}
|
||||
|
||||
/* lettura e scrittura su file */
|
||||
int pg_read(FILE *fp, pg_t *pgp)
|
||||
{
|
||||
if (fscanf(fp, " %49s %49s %49s", pgp->cod, pgp->nome, pgp->classe) != 3)
|
||||
return 0;
|
||||
|
||||
stat_read(fp, &(pgp->b_stat));
|
||||
pgp->equip = equipArray_init();
|
||||
stat_copy(&pgp->eq_stat, &pgp->b_stat);
|
||||
|
||||
return 1;
|
||||
}
|
||||
/* non essendo struct dinamica, pulisce chiamando il distruttore di equipArray */
|
||||
void pg_clean(pg_t *pgp)
|
||||
{
|
||||
free(pgp->equip);
|
||||
}
|
||||
|
||||
void pg_print(FILE *fp, pg_t *pgp, invArray_t invArray)
|
||||
{
|
||||
fprintf(fp, "%s (%s)\n Classe: %s\n Statistiche - ", pgp->nome, pgp->cod, pgp->classe);
|
||||
stat_print(fp, &(pgp->eq_stat), 0);
|
||||
equipArray_print(fp, pgp->equip, invArray);
|
||||
}
|
||||
/* modifica personaggio aggiungendo/togliendo un equipaggiamento selezionato da inventario:
|
||||
di fatto e' sufficiente chiamare l'opportuna funzione dal modulo equipArray */
|
||||
void pg_updateEquip(pg_t *pgp, invArray_t invArray)
|
||||
{
|
||||
equipArray_update(pgp->equip, invArray);
|
||||
pg_calc_stats(pgp, invArray);
|
||||
}
|
||||
|
||||
/* Si possono aggiungere altre funzioni se ritenute necessarie */
|
||||
|
||||
#endif
|
||||
35
Laboratorio 7/Esercizio 1/pg.h
Normal file
35
Laboratorio 7/Esercizio 1/pg.h
Normal file
@@ -0,0 +1,35 @@
|
||||
// Laboratorio 7 - Esercizio 1 - pg.h
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#ifndef PG_H_DEFINED
|
||||
#define PG_H_DEFINED
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "equipArray.h"
|
||||
|
||||
/* quasi ADT personaggio; si noti che si tratta di un composto con riferimento
|
||||
a un equipArray di proprieta' */
|
||||
typedef struct pg_s {
|
||||
char cod[LEN];
|
||||
char nome[LEN];
|
||||
char classe[LEN];
|
||||
stat_t b_stat, eq_stat;
|
||||
equipArray_t equip;
|
||||
} pg_t;
|
||||
|
||||
/* lettura e scrittura su file */
|
||||
int pg_read(FILE *fp, pg_t *pgp);
|
||||
/* non essendo struct dinamica, pulisce chiamando il distruttire di equipArray */
|
||||
void pg_clean(pg_t *pgp);
|
||||
|
||||
void pg_print(FILE *fp, pg_t *pgp, invArray_t invArray);
|
||||
/* modifica personaggio aggiungendo/togliendo un equipaggiamento selezionato da inventario:
|
||||
di fatto e' sufficiente chiamare l'opportuna funzione dal modulo equipArray */
|
||||
void pg_updateEquip(pg_t *pgp, invArray_t invArray);
|
||||
|
||||
/* Si possono aggiungere altre funzioni se ritenute necessarie */
|
||||
|
||||
#endif
|
||||
10
Laboratorio 7/Esercizio 1/pg.txt
Normal file
10
Laboratorio 7/Esercizio 1/pg.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
PG0001 Sephiroth Guerriero 1832 71 116 65 41 49
|
||||
PG0002 Aerith MagoBianco 976 144 12 39 121 140
|
||||
PG0003 Vivi MagoNero 1001 136 17 36 131 115
|
||||
PG0004 Beatrix Templare 1654 99 85 35 70 61
|
||||
PG0005 Orlandeau Paladino 1701 84 81 68 34 48
|
||||
PG0006 Basch Capitano 2199 46 32 98 33 89
|
||||
PG0007 Lulu MagoNero 999 139 21 33 119 117
|
||||
PG0008 Yuna Evocatrice 1019 100 32 17 97 99
|
||||
PG0009 DarkCecil CavaliereNero 1901 48 106 90 12 18
|
||||
PG0010 Kefka Arcimago 1271 89 39 47 89 64
|
||||
131
Laboratorio 7/Esercizio 1/pgList.c
Normal file
131
Laboratorio 7/Esercizio 1/pgList.c
Normal file
@@ -0,0 +1,131 @@
|
||||
// Laboratorio 7 - Esercizio 1 - pgList.c
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#ifndef PGLIST_C_DEFINED
|
||||
#define PGLIST_C_DEFINED
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "pgList.h"
|
||||
|
||||
typedef struct node_s *link;
|
||||
|
||||
typedef struct node_s {
|
||||
pg_t val;
|
||||
link next;
|
||||
} node;
|
||||
|
||||
/* ADT di prima classe collezione di personaggi */
|
||||
typedef struct pgList_s {
|
||||
link head;
|
||||
link tail;
|
||||
int nPg;
|
||||
} *pgList_t;
|
||||
|
||||
link new_node(pg_t val, link next) {
|
||||
link t = malloc(sizeof(node));
|
||||
if (t == NULL) {
|
||||
printf("ERROR: out of memory");
|
||||
exit(2);
|
||||
}
|
||||
t->val = val;
|
||||
t->next = next;
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
void free_node(link p) {
|
||||
pg_clean(&p->val);
|
||||
free(p);
|
||||
}
|
||||
|
||||
/* creatore e distruttore */
|
||||
pgList_t pgList_init() {
|
||||
pgList_t new = malloc(sizeof(struct pgList_s));
|
||||
new->head = NULL;
|
||||
new->tail = NULL;
|
||||
new->nPg = 0;
|
||||
return new;
|
||||
}
|
||||
|
||||
void pgList_free(pgList_t pgList) {
|
||||
link p, x;
|
||||
for (p = pgList->head, x = pgList->head->next; x != NULL; p = x, x = x->next){
|
||||
free_node(p);
|
||||
}
|
||||
free(pgList);
|
||||
}
|
||||
|
||||
/* lettura e scrittura su file */
|
||||
void pgList_read(FILE *fp, pgList_t pgList) {
|
||||
while (!feof(fp))
|
||||
{
|
||||
pg_t pgp;
|
||||
if (pg_read(fp, &pgp) != 0) {
|
||||
pgList_insert(pgList, pgp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pgList_print(FILE *fp, pgList_t pgList, invArray_t invArray) {
|
||||
link p;
|
||||
|
||||
for (p = pgList->head; p != NULL; p = p->next) {
|
||||
pg_print(fp, &(p->val), invArray);
|
||||
}
|
||||
}
|
||||
|
||||
/* inserimento di un nuovo personaggio */
|
||||
void pgList_insert(pgList_t pgList, pg_t pg) {
|
||||
link new = new_node(pg, NULL);
|
||||
if (pgList->head == NULL) {
|
||||
pgList->head = new;
|
||||
} else {
|
||||
pgList->tail->next = new;
|
||||
}
|
||||
|
||||
pgList->tail = new;
|
||||
}
|
||||
/* cancellazione con rimozione */
|
||||
void pgList_remove(pgList_t pgList, char* cod) {
|
||||
link p, x;
|
||||
|
||||
if (pgList->head == NULL)
|
||||
return;
|
||||
|
||||
for (x = pgList->head, p = NULL; x != NULL; p = x, x = x->next) {
|
||||
if (!strcmp(x->val.cod, cod)) {
|
||||
if (p == NULL) {
|
||||
pgList->head = x->next;
|
||||
} else {
|
||||
p->next = x->next;
|
||||
|
||||
// se tolgo l'ultimo elemento devo aggiornare `tail`
|
||||
if (x->next == NULL)
|
||||
pgList->tail = p;
|
||||
}
|
||||
|
||||
free_node(x);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ricerca per codice, ritornando il puntatore */
|
||||
pg_t *pgList_searchByCode(pgList_t pgList, char* cod) {
|
||||
link p;
|
||||
|
||||
for (p = pgList->head; p != NULL; p = p->next) {
|
||||
if (!strcmp(p->val.cod, cod)) {
|
||||
return &(p->val);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Si possono aggiungere altre funzioni se ritenute necessarie */
|
||||
|
||||
#endif
|
||||
33
Laboratorio 7/Esercizio 1/pgList.h
Normal file
33
Laboratorio 7/Esercizio 1/pgList.h
Normal file
@@ -0,0 +1,33 @@
|
||||
// Laboratorio 7 - Esercizio 1 - pgList.h
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#ifndef PGLIST_H_DEFINED
|
||||
#define PGLIST_H_DEFINED
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "pg.h"
|
||||
|
||||
/* ADT di prima classe collezione di personaggi */
|
||||
typedef struct pgList_s *pgList_t;
|
||||
|
||||
/* creatore e distruttore */
|
||||
pgList_t pgList_init();
|
||||
void pgList_free(pgList_t pgList);
|
||||
|
||||
/* lettura e scrittura su file */
|
||||
void pgList_read(FILE *fp, pgList_t pgList);
|
||||
void pgList_print(FILE *fp, pgList_t pgList, invArray_t invArray);
|
||||
|
||||
/* inserimento di un nuovo personaggio */
|
||||
void pgList_insert(pgList_t pgList, pg_t pg);
|
||||
/* cancellazione con rimozione */
|
||||
void pgList_remove(pgList_t pgList, char* cod);
|
||||
/* ricerca per codice, ritornando il puntatore */
|
||||
pg_t *pgList_searchByCode(pgList_t pgList, char* cod);
|
||||
|
||||
/* Si possono aggiungere altre funzioni se ritenute necessarie */
|
||||
|
||||
#endif
|
||||
73
Laboratorio 7/Esercizio 2/Diagonali.c
Normal file
73
Laboratorio 7/Esercizio 2/Diagonali.c
Normal file
@@ -0,0 +1,73 @@
|
||||
// Laboratorio 7 - Esercizio 2 - Diagonali.c
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "Elementi.h"
|
||||
#include "Diagonali.h"
|
||||
|
||||
typedef struct node_s *link;
|
||||
|
||||
typedef struct node_s {
|
||||
Diagonale diag;
|
||||
link next;
|
||||
} node;
|
||||
|
||||
typedef struct diagonali
|
||||
{
|
||||
link head;
|
||||
int N;
|
||||
} *Diagonali;
|
||||
|
||||
link new_node(Diagonale diag, link next) {
|
||||
link t = malloc(sizeof(node));
|
||||
if (t == NULL) {
|
||||
printf("Errore: impossibile allocare memoria");
|
||||
exit(2);
|
||||
}
|
||||
t->diag = diag;
|
||||
t->next = next;
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
void free_node(link p) {
|
||||
free(p);
|
||||
}
|
||||
|
||||
/* creatore e distruttore */
|
||||
Diagonali DiagionaliInit() {
|
||||
Diagonali new = malloc(sizeof(struct diagonali));
|
||||
new->head = NULL;
|
||||
new->N = 0;
|
||||
return new;
|
||||
}
|
||||
|
||||
void DiagonaliFree(Diagonali diags) {
|
||||
link p, x;
|
||||
for (p = diags->head, x = diags->head->next; x != NULL; p = x, x = x->next){
|
||||
free_node(p);
|
||||
}
|
||||
free(diags);
|
||||
}
|
||||
|
||||
void DiagonaliInsert(Diagonali diags, Diagonale newDiag) {
|
||||
link nd = new_node(newDiag, diags->head);
|
||||
diags->head = nd;
|
||||
diags->N++;
|
||||
}
|
||||
|
||||
link DiagonaliTraverse(Diagonali diags, link prev, Diagonale ** elem) {
|
||||
link next;
|
||||
|
||||
if (prev == NULL) {
|
||||
next = diags->head;
|
||||
} else {
|
||||
next = prev->next;
|
||||
}
|
||||
|
||||
if (next == NULL)
|
||||
return NULL;
|
||||
|
||||
*elem = &next->diag;
|
||||
return next;
|
||||
}
|
||||
27
Laboratorio 7/Esercizio 2/Diagonali.h
Normal file
27
Laboratorio 7/Esercizio 2/Diagonali.h
Normal file
@@ -0,0 +1,27 @@
|
||||
// Laboratorio 7 - Esercizio 2 - Diagonali.h
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#ifndef DIAG_H_DEFINED
|
||||
#define DIAG_H_DEFINED
|
||||
#include "Elementi.h"
|
||||
#include <stdbool.h>
|
||||
#define MAX_ELEM 5
|
||||
|
||||
typedef struct node_s *link;
|
||||
typedef struct diagonali *Diagonali;
|
||||
|
||||
typedef struct diagonale {
|
||||
Elemento elementi[MAX_ELEM];
|
||||
int N;
|
||||
float punti;
|
||||
int diff;
|
||||
bool hasFront;
|
||||
bool hasBack;
|
||||
bool hasSeq;
|
||||
} Diagonale;
|
||||
|
||||
Diagonali DiagionaliInit();
|
||||
void DiagonaliFree(Diagonali diags);
|
||||
void DiagonaliInsert(Diagonali diags, Diagonale newDiag);
|
||||
link DiagonaliTraverse(Diagonali diags, link prev, Diagonale ** elem);
|
||||
#endif
|
||||
11
Laboratorio 7/Esercizio 2/Elementi.c
Normal file
11
Laboratorio 7/Esercizio 2/Elementi.c
Normal file
@@ -0,0 +1,11 @@
|
||||
// Laboratorio 7 - Esercizio 2 - Elementi.c
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#include<stdio.h>
|
||||
#include"Elementi.h"
|
||||
|
||||
Elemento leggiElemento(FILE * fp) {
|
||||
Elemento e;
|
||||
fscanf(fp, "%s %d %d %d %d %d %f %d", e.nome, &e.tipo, &e.dirIngresso, &e.dirUscita, (int *) &e.reqPreced, (int *) &e.finale, &e.valore, &e.diff);
|
||||
return e;
|
||||
}
|
||||
25
Laboratorio 7/Esercizio 2/Elementi.h
Normal file
25
Laboratorio 7/Esercizio 2/Elementi.h
Normal file
@@ -0,0 +1,25 @@
|
||||
// Laboratorio 7 - Esercizio 2 - Elementi.h
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#ifndef ELEM_H_DEFINED
|
||||
#define ELEM_H_DEFINED
|
||||
#include<stdbool.h>
|
||||
#include<stdio.h>
|
||||
#define MAX_LEN 30
|
||||
|
||||
enum tipo { TRANSIZIONE, INDIETRO, AVANTI };
|
||||
enum direzione { SPALLE, FRONTE };
|
||||
|
||||
typedef struct elemento {
|
||||
char nome[MAX_LEN+1];
|
||||
int tipo;
|
||||
int dirIngresso;
|
||||
int dirUscita;
|
||||
bool reqPreced;
|
||||
bool finale;
|
||||
float valore;
|
||||
int diff;
|
||||
} Elemento;
|
||||
|
||||
Elemento leggiElemento(FILE * fp);
|
||||
#endif
|
||||
20
Laboratorio 7/Esercizio 2/elementi.txt
Normal file
20
Laboratorio 7/Esercizio 2/elementi.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
19
|
||||
ruota 0 1 0 0 0 0.0 1
|
||||
rondata 0 1 0 0 0 0.2 1
|
||||
ribaltata_a_2 0 1 1 0 0 0.25 2
|
||||
back_handspring 0 0 0 0 0 0.4 2
|
||||
front_tuck 2 1 1 0 0 1.75 3
|
||||
front_pike 2 1 1 0 0 2.0 4
|
||||
front_layout 2 1 1 0 0 2.25 5
|
||||
back_tuck 1 0 0 0 0 1.75 3
|
||||
back_pike 1 0 0 0 0 2.0 4
|
||||
back_layout 1 0 0 0 0 2.25 5
|
||||
double_front_tuck 2 1 1 1 0 3.0 6
|
||||
double_front_layout 2 1 1 1 1 4.0 7
|
||||
double_back_tuck 1 0 0 1 0 3.0 6
|
||||
double_back_layout 1 0 0 1 1 4.0 7
|
||||
triple_front_tuck 2 1 1 1 1 6.5 8
|
||||
triple_back_tuck 1 0 0 1 1 6.0 8
|
||||
back_layout_double_twist 1 0 0 1 0 8.0 9
|
||||
back_layout_quad_twist 1 0 0 1 1 12.0 10
|
||||
arabian 1 0 1 0 0 2.5 4
|
||||
189
Laboratorio 7/Esercizio 2/main.c
Normal file
189
Laboratorio 7/Esercizio 2/main.c
Normal file
@@ -0,0 +1,189 @@
|
||||
// Laboratorio 7 - Esercizio 2 - main.c
|
||||
// Matteo Schiff - s295565
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include "Elementi.h"
|
||||
#include "Diagonali.h"
|
||||
|
||||
Elemento *leggiFile(char *filename, int *N)
|
||||
{
|
||||
FILE *fin;
|
||||
if ((fin = fopen(filename, "r")) == NULL)
|
||||
{
|
||||
puts("Impossibile aprire il file");
|
||||
return NULL;
|
||||
}
|
||||
fscanf(fin, "%d", N);
|
||||
Elemento *lista = malloc(*N * sizeof(Elemento));
|
||||
for (int i = 0; i < *N; i++)
|
||||
{
|
||||
lista[i] = leggiElemento(fin);
|
||||
}
|
||||
fclose(fin);
|
||||
return lista;
|
||||
}
|
||||
|
||||
float calcolaPunti(Diagonale diag)
|
||||
{
|
||||
float p = 0;
|
||||
for (int i = 0; i < diag.N; i++)
|
||||
{
|
||||
p += diag.elementi[i].valore;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
void generaDiagonaleR(Diagonale tmp, Elemento *scelte, int N_scelte, int max_len, int DD, Diagonali diags)
|
||||
{
|
||||
if (tmp.N > 0 && tmp.N <= max_len)
|
||||
{
|
||||
bool el_acr = false;
|
||||
tmp.hasBack = false;
|
||||
tmp.hasFront = false;
|
||||
tmp.hasSeq = false;
|
||||
for (int i = 0; i < tmp.N; i++)
|
||||
{
|
||||
if (tmp.elementi[i].tipo == AVANTI)
|
||||
{
|
||||
el_acr = true;
|
||||
tmp.hasFront = true;
|
||||
}
|
||||
if (tmp.elementi[i].tipo == INDIETRO)
|
||||
{
|
||||
el_acr = true;
|
||||
tmp.hasBack = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i<tmp.N-1 && !tmp.hasSeq;i++) {
|
||||
if (tmp.elementi[i].tipo != TRANSIZIONE && tmp.elementi[i+1].tipo != TRANSIZIONE)
|
||||
tmp.hasSeq = true;
|
||||
}
|
||||
|
||||
if (el_acr)
|
||||
{
|
||||
tmp.punti = calcolaPunti(tmp);
|
||||
|
||||
DiagonaliInsert(diags, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
if (tmp.N == max_len || (tmp.N > 0 && tmp.elementi[tmp.N - 1].finale))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < N_scelte; i++)
|
||||
{
|
||||
// Se devo mettere il primo elemento
|
||||
if (tmp.N == 0)
|
||||
{
|
||||
if (scelte[i].reqPreced == true || scelte[i].dirIngresso == SPALLE)
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (scelte[i].dirIngresso != tmp.elementi[tmp.N - 1].dirUscita)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tmp.diff + scelte[i].diff > DD)
|
||||
continue;
|
||||
|
||||
tmp.elementi[tmp.N++] = scelte[i];
|
||||
tmp.diff += scelte[i].diff;
|
||||
generaDiagonaleR(tmp, scelte, N_scelte, max_len, DD, diags);
|
||||
tmp.diff -= scelte[i].diff;
|
||||
tmp.N--;
|
||||
}
|
||||
}
|
||||
|
||||
Diagonali generaDiagonaliValide(Elemento *elementi, int N, int DD)
|
||||
{
|
||||
Diagonali set = DiagionaliInit();
|
||||
Diagonale tmp;
|
||||
tmp.diff = 0;
|
||||
tmp.N = 0;
|
||||
|
||||
generaDiagonaleR(tmp, elementi, N, 5, DD, set);
|
||||
|
||||
return set;
|
||||
}
|
||||
|
||||
void trovaProgrammaMiglioreR(Diagonali diag, int c, Diagonale **sel, float *max, Diagonale **res, int DP, int diff)
|
||||
{
|
||||
if (c == 3)
|
||||
{
|
||||
bool hasFront = sel[0]->hasFront || sel[1]->hasFront || sel[2]->hasFront;
|
||||
bool hasBack = sel[0]->hasBack || sel[1]->hasBack || sel[2]->hasBack;
|
||||
bool hasSeq = sel[0]->hasSeq || sel[1]->hasSeq || sel[2]->hasSeq;
|
||||
|
||||
float puntiUltimaDiag = (sel[2]->elementi[sel[2]->N - 1].valore >= 8) ? sel[2]->punti * 1.5 : sel[2]->punti;
|
||||
|
||||
float points = sel[0]->punti + sel[1]->punti + puntiUltimaDiag;
|
||||
if (points > *max && diff <= DP && hasFront && hasBack && hasSeq)
|
||||
{
|
||||
*max = points;
|
||||
res[0] = sel[0];
|
||||
res[1] = sel[1];
|
||||
res[2] = sel[2];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
link p = NULL;
|
||||
Diagonale *curr;
|
||||
do
|
||||
{
|
||||
p = DiagonaliTraverse(diag, p, &curr);
|
||||
|
||||
if (curr->diff + diff > DP)
|
||||
continue;
|
||||
|
||||
sel[c] = curr;
|
||||
diff += curr->diff;
|
||||
trovaProgrammaMiglioreR(diag, c + 1, sel, max, res, DP, diff);
|
||||
diff -= curr->diff;
|
||||
} while (p != NULL);
|
||||
}
|
||||
|
||||
void stampaDiagonale(Diagonale *diag)
|
||||
{
|
||||
printf("Diagonale: [punti=%f], [difficoltà=%d] -", diag->punti, diag->diff);
|
||||
for (int i = 0; i < diag->N; i++)
|
||||
{
|
||||
printf(" %s", diag->elementi[i].nome);
|
||||
}
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
void trovaProgrammaMigliore(Diagonali diags, int DP)
|
||||
{
|
||||
float max = 0;
|
||||
Diagonale *sel[3];
|
||||
Diagonale *res[3];
|
||||
trovaProgrammaMiglioreR(diags, 0, sel, &max, res, DP, 0);
|
||||
|
||||
printf("Massimo valore: %f\n", max);
|
||||
stampaDiagonale(res[0]);
|
||||
stampaDiagonale(res[1]);
|
||||
stampaDiagonale(res[2]);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int N = 0, DP, DD;;
|
||||
Elemento *l = leggiFile("elementi.txt", &N);
|
||||
printf("Inserisci DD e DP: ");
|
||||
scanf("%d %d", &DD, &DP);
|
||||
Diagonali diags = generaDiagonaliValide(l, N, DD);
|
||||
|
||||
trovaProgrammaMigliore(diags, DP);
|
||||
|
||||
DiagonaliFree(diags);
|
||||
free(l);
|
||||
return 0;
|
||||
}
|
||||
59
Laboratorio 7/Esercizio 2/testset_risulutati.txt
Normal file
59
Laboratorio 7/Esercizio 2/testset_risulutati.txt
Normal file
@@ -0,0 +1,59 @@
|
||||
--- Test Case #1 ---
|
||||
DD = 10 DP = 20
|
||||
TOT = 17.800
|
||||
DIAG #1 > 1.750
|
||||
front_tuck
|
||||
DIAG #2 > 3.750
|
||||
front_tuck front_pike
|
||||
DIAG #3 > 8.200 * 1.5 (BONUS)
|
||||
rondata back_layout_double_twist
|
||||
|
||||
--- Test Case #2 ---
|
||||
DD = 7 DP = 30
|
||||
TOT = 11.200
|
||||
DIAG #1 > 3.700
|
||||
rondata back_tuck back_tuck
|
||||
DIAG #2 > 3.750
|
||||
front_tuck front_pike
|
||||
DIAG #3 > 3.750
|
||||
front_tuck front_pike
|
||||
|
||||
--- Test Case #3 ---
|
||||
DD = 10 DP = 35
|
||||
TOT = 26.250
|
||||
DIAG #1 > 5.750
|
||||
front_tuck double_front_layout
|
||||
DIAG #2 > 8.200
|
||||
rondata back_layout_double_twist
|
||||
DIAG #3 > 8.200 * 1.5 (BONUS)
|
||||
rondata back_layout_double_twist
|
||||
|
||||
--- Test Case #4 ---
|
||||
DD = 12 DP = 28
|
||||
TOT = 34.000
|
||||
DIAG #1 > 12.200
|
||||
rondata back_layout_quad_twist
|
||||
DIAG #2 > 3.500
|
||||
front_tuck front_tuck
|
||||
DIAG #3 > 12.200 * 1.5 (BONUS)
|
||||
rondata back_layout_quad_twist
|
||||
|
||||
--- Test Case #5 ---
|
||||
DD = 12 DP = 30
|
||||
TOT = 34.950
|
||||
DIAG #1 > 4.450
|
||||
rondata arabian front_tuck
|
||||
DIAG #2 > 12.200
|
||||
rondata back_layout_quad_twist
|
||||
DIAG #3 > 12.200 * 1.5 (BONUS)
|
||||
rondata back_layout_quad_twist
|
||||
|
||||
--- Test Case #6 ---
|
||||
DD = 11 DP = 33
|
||||
TOT = 38.750
|
||||
DIAG #1 > 12.200
|
||||
rondata back_layout_quad_twist
|
||||
DIAG #2 > 8.250
|
||||
front_tuck triple_front_tuck
|
||||
DIAG #3 > 12.200 * 1.5 (BONUS)
|
||||
rondata back_layout_quad_twist
|
||||
Reference in New Issue
Block a user