Skip to content

Instantly share code, notes, and snippets.

@aurelianonava
Last active October 3, 2017 18:31
Show Gist options
  • Select an option

  • Save aurelianonava/de622032c434ad91e4f980799e993a70 to your computer and use it in GitHub Desktop.

Select an option

Save aurelianonava/de622032c434ad91e4f980799e993a70 to your computer and use it in GitHub Desktop.
[Randominzing point along widht and height] // source http://jsbin.com/wadojuh/53
<!DOCTYPE html>
<head>
<meta name="description" content="[Randominzing point along widht and height]">
<Title> Using random(); with point() </Title>
<script data-require="p5.js@*" data-semver="0.5.7" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.7/p5.min.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body>
<h1>Randomizing function point along system variables with and height</h1> </br>
<script id="jsbin-javascript">
// code goes here:
function setup () {
createCanvas(480, 400);
}
function draw() {
background(200, 80, 220);
for(var i = 0; i < 100; i++) {
ellipse(10, 10, 10, 10);
strokeWeight(random(0,15);
point(random(0, width), random(0, height));
}
}
</script>
<script id="jsbin-source-javascript" type="text/javascript">// code goes here:
function setup () {
createCanvas(480, 400);
}
function draw() {
background(200);
for(var i = 0; i < 100; i++) {
// ellipse(10, 10, 10, 10);
strokeWeight(random(0,10));
point(random(0, width), random(0, height));
}
}
</script></body>
</html>
// code goes here:
function setup () {
createCanvas(480, 400);
}
function draw() {
background(200);
for(var i = 0; i < 100; i++) {
ellipse(10, 10, 10, 10);
strokeWeight(random(0,10));
point(random(0, width), random(0, height));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment