CodingTrain / CodingTrain/Suggestion-Box
[Quantum Continuum]: Challenge - how to enable fill good function?
- Langage dominant
- Aucune donnée de langage
- Étoiles
- 570
- Forks
- 85
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
 
### Good morning, Dear @shiffman! Good morning, Dear P5JS-citizens!
Let me ask some different alternatives regarding `"How to enable fill good function?"`
Here's my trial to solve it:
- [Live example of "fill good" function - https://gvitalie.github.io/demolution/hello/](https://gvitalie.github.io/demolution/hello/)
- [Code on GitHub - https://github.com/gvitalie/demolution/tree/gh-pages](https://github.com/gvitalie/demolution/tree/gh-pages)
> see line of code with `fill(good);`
```javascript
# sketch.js
function setup() {
createCanvas(windowWidth, windowHeight);
// frameRate(3);
rectMode(CENTER);
// noLoop();
}
function draw() {
background(127);
let step = 30;
for (let i = 0; i <= width; i += step){
for (let j = 0; j <= height; j += step){
// Enable fill(good) function.
let good = hups();
fill(good);
(round(random(0,1))) ? ellipse(i, j, step)
: rect(i, j, step, step);
}
}
}
// Fill good environment.
function hups(){
let c = [random(0, 255), random(0, 255), random(0, 255)];
return c
}
```
## The rezult:
_NOTE: Clicking on image below will open a Google Photos Shared Album_
[](https://photos.app.goo.gl/k99UV77J3uyXZvCX2)
# Fill good - Picasso stylus
[Live demo example @ https://gvitalie.github.io/demolution/fillgood/](https://gvitalie.github.io/demolution/fillgood/)
```javascript
# sketch.js
function setup() {
createCanvas(windowWidth, windowHeight);
frameRate(5);
rectMode(CENTER);
// noLoop();
}
function draw() {
background(127);
let step = 30;
for (let i = 0; i <= width; i += step){
for (let j = 0; j <= height; j += step){
let good = hups();
stroke(good);
strokeWeight(random(10, 30));
(round(random(0, 1))) ? line(i, j, i + step, j + step)
: line(i, j + step, i + step, j);
}
}
}
function hups(){
let c = [random(0, 255), random(0, 255), random(0, 255)];
return c
}
```

Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par les exemples sketch.js liés et les démos en direct, puis examinez la manière dont l’appel fill() de p5.js est censé gérer le tableau renvoyé par hups(). Clarifiez s’il s’agit d’un rapport de bug, d’un sujet de tutoriel ou d’une nouvelle fonctionnalité, et définissez le résultat visuel attendu ainsi qu’un test reproductible avant l’implémentation.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript
- Domaine
- frontend
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 20/100