diff --git a/src/utilities/conversion.js b/src/utilities/conversion.js index b640b4bd53..983d7ce61b 100644 --- a/src/utilities/conversion.js +++ b/src/utilities/conversion.js @@ -24,15 +24,13 @@ import p5 from '../core/main'; * let str = '20'; * let diameter = float(str); * ellipse(width / 2, height / 2, diameter, diameter); + * describe('20-by-20 white ellipse in the center of the canvas'); * *
* print(float('10.31')); // 10.31 * print(float('Infinity')); // Infinity * print(float('-Infinity')); // -Infinity *
- * - * @alt - * 20 by 20 white ellipse in the center of the canvas */ p5.prototype.float = function(str) { if (str instanceof Array) { diff --git a/src/utilities/string_functions.js b/src/utilities/string_functions.js index 155a1deeff..5464785a06 100644 --- a/src/utilities/string_functions.js +++ b/src/utilities/string_functions.js @@ -29,11 +29,9 @@ import '../core/friendly_errors/fes_core'; * let separator = ' '; * let message = join(array, separator); * text(message, 5, 50); + * describe('“Hello world!” displayed middle left of canvas.'); * * - * - * @alt - * "hello world!" displayed middle left of canvas. */ p5.prototype.join = function(list, separator) { p5._validateParameters('join', arguments); @@ -69,11 +67,9 @@ p5.prototype.join = function(list, separator) { * let regexp = 'p5js\\*'; * let m = match(string, regexp); * text(m, 5, 50); + * describe('“p5js*” displayed middle left of canvas.'); * * - * - * @alt - * "p5js*" displayed middle left of canvas. */ p5.prototype.match = function(str, reg) { p5._validateParameters('match', arguments); @@ -166,12 +162,11 @@ p5.prototype.matchAll = function(str, reg) { * // Draw dividing line * stroke(120); * line(0, 50, width, 50); + * + * describe('“0321.00” middle top, “-1321.00” middle bottom canvas'); * } * * - * - * @alt - * "0321.00" middle top, -1321.00" middle bottom canvas */ /** * @method nf @@ -265,12 +260,11 @@ function doNf(num, left, right) { * // Draw dividing line * stroke(120); * line(0, 50, width, 50); + * + * describe('“11,253,106.115” top middle and “1.00,1.00,2.00” displayed bottom mid'); * } * * - * - * @alt - * "11,253,106.115" top middle and "1.00,1.00,2.00" displayed bottom mid */ /** * @method nfc @@ -342,12 +336,11 @@ function doNfc(num, right) { * // Draw dividing line * stroke(120); * line(0, 50, width, 50); + * + * describe('“+11253106.11” top middle and “-11253106.11” displayed bottom middle'); * } * * - * - * @alt - * "+11253106.11" top middle and "-11253106.11" displayed bottom middle */ /** * @method nfp @@ -420,12 +413,11 @@ function addNfp(num) { * // Draw dividing line * stroke(120); * line(0, 50, width, 50); + * + * describe('“0321.00” top middle and “-1321.00” displayed bottom middle'); * } * * - * - * @alt - * "0321.00" top middle and "-1321.00" displayed bottom middle */ /** * @method nfs @@ -470,11 +462,9 @@ function addNfs(num) { * text(splitString[0], 5, 30); * text(splitString[1], 5, 50); * text(splitString[2], 5, 70); + * describe('“Pat” top left, “Xio” mid left, and “Alex” displayed bottom left'); * * - * - * @alt - * "pat" top left, "Xio" mid left and "Alex" displayed bottom left */ p5.prototype.split = function(str, delim) { p5._validateParameters('split', arguments); @@ -548,11 +538,9 @@ p5.prototype.splitTokens = function(value, delims) { * * let string = trim(' No new lines\n '); * text(string + ' here', 2, 50); + * describe('“No new lines here” displayed center canvas'); * * - * - * @alt - * "No new lines here" displayed center canvas */ /** * @method trim diff --git a/src/utilities/time_date.js b/src/utilities/time_date.js index 62f752bc92..827682bd30 100644 --- a/src/utilities/time_date.js +++ b/src/utilities/time_date.js @@ -18,11 +18,9 @@ import p5 from '../core/main'; * * let d = day(); * text('Current day: \n' + d, 5, 50); + * describe('Current day is displayed'); * * - * - * @alt - * Current day is displayed */ p5.prototype.day = function() { return new Date().getDate(); @@ -39,11 +37,9 @@ p5.prototype.day = function() { * * let h = hour(); * text('Current hour:\n' + h, 5, 50); + * describe('Current hour is displayed'); * * - * - * @alt - * Current hour is displayed */ p5.prototype.hour = function() { return new Date().getHours(); @@ -60,11 +56,9 @@ p5.prototype.hour = function() { * * let m = minute(); * text('Current minute: \n' + m, 5, 50); + * describe('Current minute is displayed'); * * - * - * @alt - * Current minute is displayed */ p5.prototype.minute = function() { return new Date().getMinutes(); @@ -82,11 +76,9 @@ p5.prototype.minute = function() { * * let millisecond = millis(); * text('Milliseconds \nrunning: \n' + millisecond, 5, 40); + * describe('number of milliseconds since sketch has started displayed'); * * - * - * @alt - * number of milliseconds since sketch has started displayed */ p5.prototype.millis = function() { if (this._millisStart === -1) { @@ -108,11 +100,9 @@ p5.prototype.millis = function() { * * let m = month(); * text('Current month: \n' + m, 5, 50); + * describe('Current month is displayed'); * * - * - * @alt - * Current month is displayed */ p5.prototype.month = function() { //January is 0! @@ -130,11 +120,9 @@ p5.prototype.month = function() { * * let s = second(); * text('Current second: \n' + s, 5, 50); + * describe('Current second is displayed'); * * - * - * @alt - * Current second is displayed */ p5.prototype.second = function() { return new Date().getSeconds(); @@ -151,11 +139,9 @@ p5.prototype.second = function() { * * let y = year(); * text('Current year: \n' + y, 5, 50); + * describe('Current year is displayed'); * * - * - * @alt - * Current year is displayed */ p5.prototype.year = function() { return new Date().getFullYear();