This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// scrivere una funzione che dati due vettori, crei un terzo vettore | |
// i cui elementi sono gli elementi comuni dei vettori di partenza senza | |
// ripetizioni | |
#include <algorithm> | |
#include <iostream> | |
#include <vector> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "DHT.h" | |
DHT dht(2,DHT11); | |
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(9600); | |
dht.begin(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <array> | |
using matrice4x3 = std::array<std::array<int,4>,3>; | |
using 😊 = int; | |
int main() { | |
matrice4x3 mat; | |
//std::array<std::array<int,4>,3> mat; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <optional> | |
bool esiste(const std::vector<int>& v,int value) { | |
for(auto i =0; i < v.size(); i++) { | |
if (v[i] == value) { | |
return true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <array> | |
#include <vector> | |
#include "raylib.h" | |
#define SCREEN_WIDTH 1000 | |
#define SCREEN_HEIGHT 800 | |
using pallina_info = std::array<float,4>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include "raylib.h" | |
#define SCREEN_WIDTH 800 | |
#define SCREEN_HEIGHT 450 | |
#define CELL_SIZE 2 | |
#define GRID_WIDTH (SCREEN_WIDTH / CELL_SIZE) | |
#define GRID_HEIGHT (SCREEN_HEIGHT / CELL_SIZE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include "raylib.h" | |
const int screen_width = 800; | |
const int screen_height = 450; | |
const int tile_size = 20; | |
const int righe = screen_height/tile_size; | |
const int colonne = screen_width/tile_size; | |
int n_celle_vive(const std::vector<bool>&world,int col, int row) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include "raylib.h" | |
const int screen_width = 800; | |
const int screen_height = 450; | |
const int tile_size = 20; | |
//------------------------------------------------------------------------------------ | |
// Program main entry point |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
#include "raylib.h" | |
const int screen_width = 800; | |
const int screen_height = 450; | |
const int tile_size = 20; | |
//------------------------------------------------------------------------------------ | |
// Program main entry point |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Siamo al polo Nord e Babbo Natale ci ha incaricati di sorvegliare i lavori per la notte del 24 dicembre. | |
Dobbiamo sorvegliare il lavoro di tutti gli elfi. | |
Ad ogni elfo chiediamo quanti giocattoli ha prodotto per Natale. | |
Vogliamo calcolare: | |
1) il totale dei giocattoli | |
2) la media dei giocattoli realizzati dagli elfi | |
3) la posizione nel vettore (cioè indice cioè la i) dell'elfo che ha prodotto più giocattoli | |
4) quanti elfi hanno prodotto più giocattoli della media | |
5)creare un menu (con uno switch) che in base al valore scelto permette di svolgere i punti 1, 2, 3, 4. | |
BISOGNA RESTARE NEL MENU FINO A CHE UNO NON SCEGLI DI USCIRE |