Skip to content

Commit 49f1857

Browse files
committed
Refactoring: organized project structure and added documentation
1 parent c57d6eb commit 49f1857

File tree

8 files changed

+94
-5
lines changed

8 files changed

+94
-5
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 [IL TUO NOME O USERNAME]
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
CC = gcc
2+
CFLAGS = -Wall -Wextra -std=c11 -Iinclude
3+
TARGET = gioco
4+
5+
# Rilevamento sistema operativo per l'estensione dell'eseguibile
6+
ifeq ($(OS),Windows_NT)
7+
EXE = .exe
8+
RM = del /Q
9+
MKDIR = if not exist obj mkdir obj
10+
else
11+
EXE =
12+
RM = rm -rf
13+
MKDIR = mkdir -p obj
14+
endif
15+
16+
# Trova tutti i file .c in src
17+
SRCS = src/main.c src/funzioni.c
18+
# Definisce i file .o che verranno creati nella cartella obj
19+
OBJS = obj/main.o obj/funzioni.o
20+
21+
# Regola principale
22+
all: $(TARGET)$(EXE)
23+
24+
# Crea l'eseguibile unendo i file oggetto
25+
$(TARGET)$(EXE): $(OBJS)
26+
$(CC) $(CFLAGS) -o $(TARGET)$(EXE) $(OBJS)
27+
28+
# Compila i singoli file .c in .o
29+
obj/%.o: src/%.c | obj
30+
$(CC) $(CFLAGS) -c $< -o $@
31+
32+
# Crea la cartella obj se non esiste
33+
obj:
34+
$(MKDIR)
35+
36+
# Pulisce i file compilati
37+
clean:
38+
$(RM) obj $(TARGET)$(EXE)
39+
40+
# Compila ed esegue in un colpo solo
41+
run: all
42+
./$(TARGET)$(EXE)

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# 🧬 Gioco: A Hardcore Life Simulator in C
2+
3+
[![Language: C](https://img.shields.io/badge/Language-C-blue.svg)](https://en.wikipedia.org/wiki/C_(programming_language))
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5+
[![Status: Active Development](https://img.shields.io/badge/Status-Active_Development-green.svg)]()
6+
7+
**Gioco** is a deep, text-based life simulation engine developed in pure C. Experience a journey from birth to death across 13 different nations, navigating the complexities of health, education, crime, and social status.
8+
9+
> "A project born to explore procedural logic and memory management without the bloat of modern engines."
10+
11+
## ✨ Features
12+
- **Global Diversity:** Start your life in countries like India, USA, Italy, China, and more, each with unique socio-economic factors.
13+
- **Career Paths:** From a simple cashier to an **Ethical Hacker** or **Nuclear Engineer**.
14+
- **Emergent Gameplay:** Random events including military drafts, kidnapping, nuclear meltdowns, and more.
15+
- **Dynamic History:** Uses **Linked Lists** to track and display every year of your character's life at the end of the game.
16+
- **Health & Addictions:** Realistic management of addictions (gambling, alcohol, drugs) and mental health disorders.
17+
18+
## 📁 Project Structure
19+
```text
20+
MIOSIMULATOREINC/
21+
├── src/ # Source files (.c)
22+
├── include/ # Header files (.h)
23+
├── Makefile # Automation tool for compilation
24+
├── LICENSE # MIT License
25+
└── README.md # Documentation
File renamed without changes.

funzioni.h renamed to include/funzioni.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#ifndef FUNZIONI_H
22
#define FUNZIONI_H
3+
34
#include "player.h"
45

56
void controlQi(struct Giocatore *controlQi, int *controlLife);
File renamed without changes.

funzioni.c renamed to src/funzioni.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#include <string.h>
66
#include <unistd.h>
77

8-
#include "funzioni.h"
9-
#include "costanti.h"
8+
#include "../include/funzioni.h"
9+
#include "../include/costanti.h"
1010

1111
void controlQi(struct Giocatore *controlQi, int *controlLife)
1212
{

main.c renamed to src/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#include <string.h>
44
#include <time.h>
55

6-
#include "costanti.h"
7-
#include "player.h"
8-
#include "funzioni.h"
6+
#include "../include/funzioni.h"
7+
#include "../include/costanti.h"
8+
#include "../include/player.h"
99

1010
int main()
1111
{

0 commit comments

Comments
 (0)