{"size": 2173, "ext": "js", "max_stars_repo_path": "MariangelaCatucci/p5.js/Generatore casuale di parole/sketch.js", "max_stars_repo_name": "maricatuK/archive", "max_stars_repo_stars_event_min_datetime": "2021-05-29T08:11:21.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-29T08:11:21.000Z", "max_issues_repo_path": "MariangelaCatucci/p5.js/Generatore casuale di parole/sketch.js", "max_issues_repo_name": "maricatuK/archive", "max_issues_repo_issues_event_min_datetime": "2021-03-10T18:36:59.000Z", "max_issues_repo_issues_event_max_datetime": "2021-06-20T14:33:16.000Z", "max_forks_repo_path": "MariangelaCatucci/p5.js/Generatore casuale di parole/sketch.js", "max_forks_repo_name": "maricatuK/archive", "max_forks_repo_forks_event_min_datetime": "2021-03-05T14:14:50.000Z", "max_forks_repo_forks_event_max_datetime": "2021-03-05T14:16:18.000Z"}
{"max_stars_count": 1, "max_issues_count": 29, "max_forks_count": 14, "avg_line_length": 35.6229508197, "max_line_length": 214, "alphanum_fraction": 0.6741831569}
// Generatore di parole 0.1 by Mariangela Catucci [parole, colore, frasi]
// 2021 © Mariangela @MariangelaCatucci, Daniele @Fupete and the course DS-2021 at DESIGN.unirsm 
// github.com/ds-2021-unirsm — github.com/fupete
// Educational purposes, MIT License, 2021, San Marino
// —

var button;

function setup() {
  createCanvas(windowWidth, windowHeight);
  background(225, 0, 0, 10);
  
  button = createButton('Nome');
  button.position((windowWidth/2) - ((windowWidth/2)/2), windowHeight/2);
  button.mousePressed(nomi);
  
  button = createButton('Verbo');
  button.position((windowWidth/2) , windowHeight/2);
  button.mousePressed(verbi);

  button = createButton('Complemento');
  button.position((windowWidth/2) + ((windowWidth/2)/2), windowHeight/2);
  button.mousePressed(complementi);
  
  button = createButton('Reset');
  button.position(windowWidth/2, (windowHeight/2) + 200);
  button.mousePressed(reset);
  
}

function nomi(){
  let elenco_nomi = ['Gatto', 'Alberto', 'Bicchiere', 'Giovanni', 'Estate', 'Piatto', 'Albero','Chiara', 'Vaso', 'Acqua', 'Computer', 'Balcone', 'Scatola', 'Tonno', 'Luigi', 'Piazza', 'Anna', 'Angela', 'Carlo'];
  let nome = random(elenco_nomi);
  textSize(18);
  textAlign(LEFT);
  text(nome, (windowWidth/2) - ((windowWidth/2)/2), (windowHeight/2) - 100); 
  textFont('arial')
}

function verbi(){
  let elenco_verbi = ['sarà', 'è', 'mangia', 'beve', 'si lava', 'fa', 'è andato/a', 'salito/a', 'vedrà', 'cammina', 'scrive', 'consuma', 'presenterà', 'ha cucinato', 'ha fatto', 'piange', 'aveva provato', 'nuota'];
  let verbo = random(elenco_verbi);
  textSize(18);
  textAlign(LEFT);
  text(verbo, (windowWidth/2), (windowHeight/2) - 100);
  textFont('arial')
}

function complementi(){
  let elenco_complementi = ['sera', 'cosa', 'pane', 'domani', 'sopra', 'sotto', 'felice', 'nero', 'acido', 'interessante', 'brutto', 'importante', 'trsite', 'incomprensibile'];
  let complemento = random(elenco_complementi);
  textSize(18);
  textAlign(LEFT);
  text(complemento, (windowWidth/2) + ((windowWidth/2)/2), (windowHeight/2) - 100);
  textFont('arial')
}

function reset () {
 background(random(255),random(255), random(255));
}
