Istruzioni
echo 'Viva PHP';
$x = 'Pippo';
if($x=='Pippo'){
echo '<b>Ok</b>';}
Commenti
/* Questo รจ un commento
per gli umani */
$x='pippo'; //anche questo
Commenti
PHP 5 Syntax
input / output
echo '<form action="basics.php" method="post">
<input type="text" name="nome" value="Tuo nome?" >
<input type="submit" value="Invia" >
</form>';
if($_POST['nome']){echo '<span style="background-color:pink;">Ciao '.$_POST['nome'].'</span>';}
Hello World - Click qui
<p id="demo" onclick="document.getElementById('demo').innerHTML = x;" style="text-align:left"> Hello World - Click qui </p>
<script> var x = 'Istruzioni'; </script>
MDN JS - Basics
Statements
Commenti
/*
Tra '/*' e '*/'
scriviamo i commenti
agli umani
*/
/* Non si può avere un commento dentro /* un commento */ SyntaxError */
MDN JS Comments
Comments
input/output - click sul codice
<p id="demo" onclick="myFunction()" style="text-align:left" >click qui</p>
<script> function myFunction() {
document.getElementById("out").innerHTML = "e anche qui";
window.alert("e qui vedrai il risultato");
} </script>
MDN JS
Output int v;
int w;
int s;
int t;
line(150,150,20,20);
v = 20;
w = 30;
s = 140;
t = 150;
line(v,w,s,t);
line(w,s,t,v);
Commenti
/*
commenti
*/
Processing
p5js
input/output
void setup() {
size(640, 360);
stroke(255,0,0);
strokeWeight(1);
background(255);
}
void draw() {
//background(255); // try with
text("qui possiamo scrivere", 50, 50);
line(width/2, height/2, mouseX, mouseY);
}
p5js più complesso (vedi source pagina)
Processing
p5js PHP is a server-side scripting language designed for web development but also used .....
wikipediaJavaScript ("JS" for short) is a full-fledged dynamic programming language that, when applied to an HTML document, can provide dynamic interactivity on websites. It was invented by Brendan Eich, co-founder of the Mozilla project, the Mozilla Foundation, and the Mozilla Corporation. JavaScript is incredibly versatile. You can start small, with carousels, image galleries, fluctuating layouts, and responses to button clicks. With more experience, you'll be able to create games, animated 2D and 3D graphics, comprehensive database-driven apps, and much more!.....
MDN JavaScript basicsHello! p5.js is a JavaScript library that starts with the original goal of Processing, to make coding accessible for artists, designers, educators, and beginners, and reinterprets this for today's web.
p5.jsAccademia Statale Belle Arti Albertina Torino | ABTEC40 - Chiari- a.a.24.25| Thanks to http://templated.co.