1
1
mirror of https://github.com/chubin/cheat.sh.git synced 2024-11-22 18:17:38 +03:00

updated tests

This commit is contained in:
Igor Chubin 2020-08-06 07:28:08 +02:00
parent 43e06193c3
commit 1c3bec6a7f
5 changed files with 689 additions and 366 deletions

View File

@ -1,10 +1,12 @@
1_Inheritance
1line
2_Multiple_Inheritance
:learn
:list
Advanced
Classes
Comments
Control_Flow
Control_Flow_and_Iterables
Functions
Modules
Primitive_Datatypes_and_Operators

File diff suppressed because it is too large Load Diff

View File

@ -65,7 +65,9 @@ Bitmap-Bresenhams-line-algorithm
Bitmap-Flood-fill
Bitmap-Histogram
Bitmap-Midpoint-circle-algorithm
Bitmap-PPM-conversion-through-a-pipe
Bitmap-Read-a-PPM-file
Bitmap-Read-an-image-through-a-pipe
Bitmap-Write-a-PPM-file
Bitwise-IO
Bitwise-operations
@ -92,10 +94,12 @@ Casting-out-nines
Catalan-numbers
Catalan-numbers-Pascals-triangle
Catamorphism
Catmull-Clark-subdivision-surface
Character-codes
Chat-server
Check-Machin-like-formulas
Check-that-file-exists
Checkpoint-synchronization
Chinese-remainder-theorem
Cholesky-decomposition
Circles-of-given-radius-through-two-points
@ -107,6 +111,7 @@ Color-of-a-screen-pixel
Color-quantization
Colour-bars-Display
Colour-pinstripe-Display
Colour-pinstripe-Printer
Combinations
Combinations-and-permutations
Combinations-with-repetitions
@ -141,6 +146,7 @@ Day-of-the-week
Deal-cards-for-FreeCell
Death-Star
Deconvolution-1D
Deconvolution-2D+
Deepcopy
Define-a-primitive-data-type
Delegates
@ -689,6 +695,7 @@ Variadic-function
Vector-products
Verify-distribution-uniformity-Chi-squared-test
Verify-distribution-uniformity-Naive
Video-display-modes
Vigen-re-cipher
Vigen-re-cipher-Cryptanalysis
Visualize-a-tree
@ -715,6 +722,7 @@ Y-combinator
Yahoo--search-interface
Yin-and-yang
Zebra-puzzle
Zeckendorf-arithmetic
Zeckendorf-number-representation
Zero-to-the-zero-power
Zhang-Suen-thinning-algorithm

View File

@ -164,7 +164,7 @@
// Join all elements of an array with semicolon
var myArray0 = [32,false,"js",12,56,90];
myArray0.join(";") // = "32;false;js;12;56;90"
myArray0.join(";"); // = "32;false;js;12;56;90"
// Get subarray of elements from index 1 (include) to 4 (exclude)
myArray0.slice(1,4); // = [false,"js",12]
@ -562,3 +562,45 @@
 return new Constructor();
 };
}
// ES6 Additions
// The "let" keyword allows you to define variables in a lexical scope, 
// as opposed to a block scope like the var keyword does.
let name = "Billy";
// Variables defined with let can be reassigned new values.
name = "William";
// The "const" keyword allows you to define a variable in a lexical scope
// like with let, but you cannot reassign the value once one has been assigned.
const pi = 3.14;
pi = 4.13; // You cannot do this.
// There is a new syntax for functions in ES6 known as "lambda syntax".
// This allows functions to be defined in a lexical scope like with variables
// defined by const and let. 
const isEven = (number) => {
 return number % 2 === 0;
};
isEven(7); // false
// The "equivalent" of this function in the traditional syntax would look like this:
function isEven(number) {
 return number % 2 === 0;
};
// I put the word "equivalent" in double quotes because a function defined
// using the lambda syntax cannnot be called before the definition.
// The following is an example of invalid usage:
add(1, 8);
const add = (firstNumber, secondNumber) => {
 return firstNumber + secondNumber;
};

View File

@ -164,7 +164,7 @@
// Join all elements of an array with semicolon
var myArray0 = [32,false,"js",12,56,90];
myArray0.join(";") // = "32;false;js;12;56;90"
myArray0.join(";"); // = "32;false;js;12;56;90"
// Get subarray of elements from index 1 (include) to 4 (exclude)
myArray0.slice(1,4); // = [false,"js",12]
@ -562,3 +562,45 @@
 return new Constructor();
 };
}
// ES6 Additions
// The "let" keyword allows you to define variables in a lexical scope, 
// as opposed to a block scope like the var keyword does.
let name = "Billy";
// Variables defined with let can be reassigned new values.
name = "William";
// The "const" keyword allows you to define a variable in a lexical scope
// like with let, but you cannot reassign the value once one has been assigned.
const pi = 3.14;
pi = 4.13; // You cannot do this.
// There is a new syntax for functions in ES6 known as "lambda syntax".
// This allows functions to be defined in a lexical scope like with variables
// defined by const and let. 
const isEven = (number) => {
 return number % 2 === 0;
};
isEven(7); // false
// The "equivalent" of this function in the traditional syntax would look like this:
function isEven(number) {
 return number % 2 === 0;
};
// I put the word "equivalent" in double quotes because a function defined
// using the lambda syntax cannnot be called before the definition.
// The following is an example of invalid usage:
add(1, 8);
const add = (firstNumber, secondNumber) => {
 return firstNumber + secondNumber;
};