// ------- //
// array //
// ------- //
function get_length_of_array__function_by_f_kromberg( ar ) {
/* use:
var l = get_length_of_array__function_by_f_kromberg( ar = [ 1, 2, 3 ] );
*/
/* meta data:
tree: array
tags: array, length
info: get length of array
date: 2023-10-04
code: JS
test: ok
*/
var l = ar.length;
return l;
} // function
function get_id_of_last_element_of_array__function_by_f_kromberg( ar ) {
/* use:
var last_id = get_id_of_last_element_of_array__function_by_f_kromberg( ar = [ 1, 2, 3] );
*/
/* meta data:
tree: array
tags: array, last element
info: get id of last element of array
date: 2023-10-04
code: JS
test: ok
*/
/*
0 1 2 3 4 >> 5
11 22 33 44 55
*/
var l = get_length_of_array__function_by_f_kromberg( ar );
var new_id = l - 1;
return new_id;
} // function
function get_id_of_new_element_of_array__function_by_f_kromberg( ar ) {
/* use:
var id_new = get_id_of_new_element_of_array__function_by_f_kromberg( ar = [ 1, 2, 3] );
*/
/* meta data:
tree: array
tags: array, new element
info: get id of new element of array
date: 2023-10-04
code: JS
test: ok
*/
/*
0 1 2 3 4 >> 5
11 22 33 44 55
*/
var last_id = get_id_of_last_element_of_array__function_by_f_kromberg( ar );
var new_id = last_id + 1;
return new_id;
} // function
// -------------------------------------- //
// ... / push elements forward/backward //
// -------------------------------------- //
// --------------- //
// ... / ... / 1 //
// --------------- //
function push_elements_of_array_forward__function_by_f_kromberg( ar, from, to ) {
/* use:
var ar = push_elements_of_array_forward__function_by_f_kromberg(
ar = [ 1, 2, 3, 4, 5 ],
from = 1,
to = 2
);
*/
/* meta data:
tree: array / push elements forward/backward / 1
tags: array, push elements
info: push elements of array forward
date: 2023-10-04
code: JS
test: ok
*/
/*
0 1 [ 2 3 4 ] 5 6
11 22 [ 33 44 55 ] 66 77
11 22 null [ 33 44 55 ] 77
0 1 2 3 [ 4 5 6 ]
11 22 33 44 [ 55 66 77 ]
11 22 33 44 null [ 55 66 ]
*/
var last_id = get_id_of_last_element_of_array__function_by_f_kromberg( ar ); // last id of array
var last_but_one_id = last_id - 1; // last but one id of array
if ( to > last_but_one_id ) to = last_but_one_id; // no exceeding allowed
var to_in_loop = to + 1; // for loop (following), e.g. 4 >> 5
var from_in_loop = from + 1; // for loop (following), e.g. 2 >> 3
var i, left_el;
for ( i=to_in_loop; i>=from_in_loop; i-- ) { // loop
left_el = ar[i-1];
ar[i] = left_el;
} // for
ar[from] = null; // set "from" to "null"
return ar;
} // function
function push_elements_of_array_backward__function_by_f_kromberg( ar, from, to ) {
/* use:
var ar = push_elements_of_array_backward__function_by_f_kromberg(
ar = [ 1, 2, 3, 4, 5 ],
from = 3,
to = 4
);
*/
/* meta data:
tree: array / push elements forward/backward / 1
tags: array, push elements
info: push elements of array backward
date: 2023-10-04
code: JS
test: ok
*/
/*
0 1 [ 2 3 4 ] 5 6
11 22 [ 33 44 55 ] 66 77
11 [ 33 44 55 ] null 66 77
[ 0 1 2 ] 3 4 5 6
[ 11 22 33 ] 44 55 66 77
[ 22 33 ] null 44 55 66 77
*/
var first_id = 0;
var second_id = first_id + 1; // second id of array
if ( from < second_id ) from = second_id; // no exceeding allowed
var from_in_loop = from - 1; // for loop (following), e.g. 2 >> 1
var to_in_loop = to - 1; // for loop (following), e.g. 4 >> 3
var i, right_el;
for ( i=from_in_loop; i<=to_in_loop; i++ ) { // loop
right_el = ar[i+1];
ar[i] = right_el;
} // for
ar[to] = null; // set "to" to "null"
return ar;
} // function
// --------------- //
// ... / ... / 2 //
// --------------- //
function push_elements_of_array_forward_from_id_to_end__function_by_f_kromberg( ar, id ) {
/* use:
var ar = push_elements_of_array_forward_from_id_to_end__function_by_f_kromberg(
ar = [ 1, 2, 3, 4, 5 ],
id = 2
);
*/
/* meta data:
tree: array / push elements forward/backward / 2
tags: array, push elements
info: push elements of array forward from id to end
date: 2023-10-04
code: JS
test: ok
*/
var last_id = get_id_of_last_element_of_array__function_by_f_kromberg( ar ); // last id of array
var from = id;
var to = last_id;
var ar = push_elements_of_array_forward__function_by_f_kromberg( ar, from, to );
return ar;
} // function
function push_elements_of_array_forward_from_start_to_id__function_by_f_kromberg( ar, id ) {
/* use:
var ar = push_elements_of_array_forward_from_start_to_id__function_by_f_kromberg(
ar = [ 1, 2, 3, 4, 5 ],
id = 2
);
*/
/* meta data:
tree: array / push elements forward/backward / 2
tags: array, push elements
info: push elements of array forward from start to id
date: 2023-10-04
code: JS
test: ok
*/
var first_id = 0; // first id of array
var from = first_id;
var to = id;
var ar = push_elements_of_array_forward__function_by_f_kromberg( ar, from, to );
return ar;
} // function
// --------------- //
// ... / ... / 3 //
// --------------- //
function push_elements_of_array_backward_from_id_to_end__function_by_f_kromberg( ar, id ) {
/* use:
var ar = push_elements_of_array_backward_from_id_to_end__function_by_f_kromberg(
ar = [ 1, 2, 3, 4, 5 ],
id = 2
);
*/
/* meta data:
tree: array / push elements forward/backward / 3
tags: array, push elements
info: push elements of array backward from id to end
date: 2023-10-04
code: JS
test: ok
*/
var last_id = get_id_of_last_element_of_array__function_by_f_kromberg( ar ); // last id of array
var from = id;
var to = last_id;
var ar = push_elements_of_array_backward__function_by_f_kromberg( ar, from, to );
return ar;
} // function
function push_elements_of_array_backward_from_start_to_id__function_by_f_kromberg( ar, id ) {
/* use:
var ar = push_elements_of_array_backward_from_start_to_id__function_by_f_kromberg(
ar = [ 1, 2, 3, 4, 5 ],
id = 2
);
*/
/* meta data:
tree: array / push elements forward/backward / 3
tags: array, push elements
info: push elements of array backward from start to id
date: 2023-10-04
code: JS
test: ok
*/
var first_id = 0; // first id of array
var from = first_id;
var to = id;
var ar = push_elements_of_array_backward__function_by_f_kromberg( ar, from, to );
return ar;
} // function
// ------------------ //
// ... / add/remove //
// ------------------ //
// --------------- //
// ... / ... / 1 //
// --------------- //
function add_element_to_array__function_by_f_kromberg( ar, el ) {
/* use:
var ar = add_element_to_array__function_by_f_kromberg(
ar = [ 1, 2, 3 ],
el = 5
);
*/
/* meta data:
tree: array / add/remove / 1
tags: array, add element
info: add element to array
date: 2023-10-04
code: JS
test: ok
*/
var new_id = get_id_of_new_element_of_array__function_by_f_kromberg( ar );
ar[new_id] = el;
return ar;
} // function
function remove_last_element_of_array__function_by_f_kromberg( ar ) {
/* use:
var ar = remove_last_element_of_array__function_by_f_kromberg( ar );
*/
/* meta data:
tree: array / add/remove / 1
tags: array, remove element
info: remove last element of array
date: 2023-10-04
code: JS
test: ok
*/
ar.pop();
return ar;
} // function
// --------------- //
// ... / ... / 2 //
// --------------- //
function add_element_anywhere_in_array__function_by_f_kromberg( ar, id, el ) {
/* use:
var ar = add_element_anywhere_in_array__function_by_f_kromberg(
ar = [ 1, 2, 3, 4, 5],
id = 2,
el = 11
);
*/
/* meta data:
tree: array / add/remove / 2
tags: array, add element
info: add element anywhere in array
date: 2023-10-04
code: JS
test: ok
*/
ar = add_element_to_array__function_by_f_kromberg(
ar,
/* el = */ null
);
ar = push_elements_of_array_forward_from_id_to_end__function_by_f_kromberg(
ar,
id
);
ar[id] = el;
return ar;
} // function
function remove_any_element_of_array__function_by_f_kromberg( ar, id ) {
/* use:
var ar = remove_any_element_of_array__function_by_f_kromberg(
ar = [ 1, 2, 3, 4, 5 ],
id = 2
);
*/
/* meta data:
tree: array / add/remove / 2
tags: array, remove element
info: remove any element of array
date: 2023-10-04
code: JS
test: ok
*/
var id_push = id + 1;
ar = push_elements_of_array_backward_from_id_to_end__function_by_f_kromberg(
ar,
/* id = */ id_push
);
remove_last_element_of_array__function_by_f_kromberg( ar );
return ar;
} // function
// --------------- //
// ... / ... / 3 //
// --------------- //
function add_element_as_first_element_of_array__function_by_f_kromberg( ar, el ) {
/* use:
var ar = add_element_as_first_element_of_array__function_by_f_kromberg(
ar = [ 1, 2, 3, 4, 5 ],
el = 11
);
*/
/* meta data:
tree: array / add/remove / 3
tags: array, add element
info: add element as first element of array
date: 2023-10-04
code: JS
test: ok
*/
ar = add_element_anywhere_in_array__function_by_f_kromberg(
ar,
id = 0,
el
);
return ar;
} // function
function remove_first_element_of_array__function_by_f_kromberg( ar ) {
/* use:
var ar = remove_first_element_of_array__function_by_f_kromberg( ar = [ 1, 2, 3, 4, 5 ] );
*/
/* meta data:
tree: array / add/remove / 3
tags: array, remove element
info: remove first element of array
date: 2023-10-04
code: JS
test: ok
*/
var ar = remove_any_element_of_array__function_by_f_kromberg(
ar,
id = 0
);
return ar;
} // function
// ------- //
// maths //
// ------- //
// --------------- //
// .. / geometry //
// --------------- //
// ------------------------------ //
// .. / .. / rectangular cuboid //
// ------------------------------ //
function readme_rectangular_cuboid__readme_by_f_kromberg() {
/* meta data:
tree: maths / geometry / rectangular cuboid
tags: rectangular cuboid, Quader (German)
info: shows shape of rectangular cuboid
date: 2023-09-19
code: JS
test: ok
*/
/*
-------------------------
/ /|
/ W [A] / |
/ L / |
------------------------- |
| |[B]|
| | /
| H [C] | /
| | /
| |/
-------------------------
*/
} // function
// ------------------ //
// .. / .. / .. / 1 //
// ------------------ //
function get_lateral_area_of_rectangular_cuboid__function_by_f_kromberg( l, w, h ) {
/* use:
r = get_lateral_area_of_rectangular_cuboid(
l = 5,
w = 5,
h = 5
);
*/
/* meta data:
tree: maths / geometry / rectangular cuboid / 1
tags: rectangular cuboid, Quader (German)
info: calculates lateral area of rectangular cuboid (German: Mantelflaeche eines Quaders)
date: 2023-09-13
code: JS
test: ok
*/
var r = 2 * ( l + w ) * h;
return r;
} // function
// ------------------ //
// .. / .. / .. / 2 //
// ------------------ //
function get_lateral_area_plus_top_surface_of_rectangular_cuboid__function_by_f_kromberg( l, w, h ) {
/* use:
r = get_lateral_area_plus_top_surface_of_rectangular_cuboid(
l = 5,
w = 5,
h = 5
);
*/
/* meta data:
tree: maths / geometry / rectangular cuboid / 2
tags: rectangular cuboid, Quader (German)
info: calculates lateral area plus top surface of rectangular cuboid (German: Mantelflaeche plus Deckflaeche eines Quaders)
date: 2023-09-18
code: JS
test: ok
*/
var r = 2 * ( l + w ) * h + l * w;
return r;
} // function
// ------------------ //
// .. / .. / .. / 3 //
// ------------------ //
function get_surface_of_rectangular_cuboid__function_by_f_kromberg( l, w, h ) {
/* use:
r = get_surface_of_rectangular_cuboid(
l = 5,
w = 5,
h = 5
);
*/
/* meta data:
tree: maths / geometry / rectangular cuboid / 3
tags: rectangular cuboid, Quader (German)
info: calculates surface of rectangular cuboid (German: Oberflaeche eines Quaders)
date: 2023-09-18
code: JS
test: ok
*/
var r = 2 * ( l * w + l * h + w * h );
return r;
} // function
// ------------------ //
// .. / .. / .. / 4 //
// ------------------ //
function get_volume_of_rectangular_cuboid__function_by_f_kromberg( l, w, h ) {
/* use:
r = get_volume_of_rectangular_cuboid(
l = 5,
w = 5,
h = 5
);
*/
/* meta data:
tree: maths / geometry / rectangular cuboid / 4
tags: rectangular cuboid, Quader (German)
info: calculates volume of rectangular cuboid (German: Volumen eines Quaders)
date: 2023-09-18
code: JS
test: ok
*/
var r = l * w * h;
return r;
} // function
// ---------- //
// printing //
// ---------- //
// --------- //
// ... / 1 //
// --------- //
// ------------------- //
// ... / ... / parts //
// ------------------- //
// --------------------- //
// ... / ... / ... / 1 //
// --------------------- //
function get_br__function_by_f_kromberg() {
/* use:
var br = get_br__function_by_f_kromberg();
*/
/* meta data:
tree: printing / 1 / parts / 1
tags: printing, string, br
info: get br string
date: 2023-09-26
code: JS
test: ok
*/
var str = "<br>";
return str;
} // function
function get_n__function_by_f_kromberg() {
/* use:
var n = get_n__function_by_f_kromberg();
*/
/* meta data:
tree: printing / 1 / parts / 1
tags: printing, string, n
info: get n string
date: 2023-09-26
code: JS
test: ok
*/
var str = "\n";
return str;
} // function
// --------------------- //
// ... / ... / ... / 2 //
// --------------------- //
function get_text_br__function_by_f_kromberg( text ) {
/* use:
var str = get_text_br__function_by_f_kromberg( text = "" );
*/
/* meta data:
tree: printing / 1 / parts / 2
tags: printing, string, br
info: get text + br string
date: 2023-09-26
code: JS
test: ok
*/
var br = get_br__function_by_f_kromberg();
var str = text + br;
return str;
} // function
function get_text_br_n__function_by_f_kromberg( text ) {
/* use:
var str = get_text_br_n__function_by_f_kromberg( text = "" );
*/
/* meta data:
tree: printing / 1 / parts / 2
tags: printing, string, br, n
info: get text + br + n string
date: 2023-09-26
code: JS
test: ok
*/
var str = get_text_br__function_by_f_kromberg( text );
var n = get_n__function_by_f_kromberg();
str += n;
return str;
} // function
function get_text_n__function_by_f_kromberg( text ) {
/* use:
var str = get_text_n__function_by_f_kromberg( text = "" );
*/
/* meta data:
tree: printing / 1 / parts / 2
tags: printing, string, n
info: get text + n string
date: 2023-09-26
code: JS
test: ok
*/
var n = get_n__function_by_f_kromberg();
var str = text + n;
return str;
} // function
// -------------------------------- //
// ... / ... / ... / compilations //
// -------------------------------- //
// --------------------------- //
// ... / ... / ... / ... / 1 //
// --------------------------- //
function get_array_printing_string__function_by_f_kromberg( ar, nr_bool ) {
/* use:
var str = get_array_printing_string__function_by_f_kromberg(
ar = [ 1, 2, 3 ],
nr_bool = true
);
*/
/* meta data:
tree: printing / 1 / parts / compilations / 1
tags: printing, array
info: get array string
date: 2023-09-26
code: JS
test: ok
*/
var l = ar.length;
var i, j, el;
var str = "";
var nr_post = ": ";
for ( i=0; i<l; i++ ) {
j = i + 1;
el = ar[i];
if ( nr_bool ) str += j + nr_post;
str += el;
} // for
return str;
} // function
// --------------------------- //
// ... / ... / ... / ... / 2 //
// --------------------------- //
function get_array_br_n_printing_string__function_by_f_kromberg( ar, nr_bool ) {
/* use:
var str = get_array_br_n_printing_string__function_by_f_kromberg(
ar = [ 1, 2, 3 ],
nr_bool = true
);
*/
/* meta data:
tree: printing / 1 / parts / compilations / 2
tags: printing, array, br, n
info: get array + br + n string
date: 2023-09-26
code: JS
test: ok
*/
var l = ar.length;
var i, j, el;
var str = "";
var nr_post = ": ";
var br = get_br__function_by_f_kromberg();
var n = get_n__function_by_f_kromberg();
for ( i=0; i<l; i++ ) {
j = i + 1;
el = ar[i];
if ( nr_bool ) str += j + nr_post;
str += el + br + n;
} // for
return str;
} // function
function get_array_br_printing_string__function_by_f_kromberg( ar, nr_bool ) {
/* use:
var str = get_array_br_printing_string__function_by_f_kromberg(
ar = [ 1, 2, 3 ],
nr_bool = true
);
*/
/* meta data:
tree: printing / 1 / parts / compilations / 2
tags: printing, array, br
info: get array + br string
date: 2023-09-26
code: JS
test: ok
*/
var l = ar.length;
var i, j, el;
var str = "";
var nr_post = ": ";
var br = get_br__function_by_f_kromberg();
for ( i=0; i<l; i++ ) {
j = i + 1;
el = ar[i];
if ( nr_bool ) str += j + nr_post;
str += el + br;
} // for
return str;
} // function
function get_array_n_printing_string__function_by_f_kromberg( ar, nr_bool ) {
/* use:
var str = get_array_n_printing_string__function_by_f_kromberg(
ar = [ 1, 2, 3 ],
nr_bool = true
);
*/
/* meta data:
tree: printing / 1 / parts / compilations / 2
tags: printing, array, n
info: get array + n string
date: 2023-09-26
code: JS
test: ok
*/
var l = ar.length;
var i, j, el;
var str = "";
var nr_post = ": ";
var n = get_n__function_by_f_kromberg();
for ( i=0; i<l; i++ ) {
j = i + 1;
el = ar[i];
if ( nr_bool ) str += j + nr_post;
str += el + n;
} // for
return str;
} // function
// ---------------------------- //
// ... / ... / ... / ... / 3 //
// ---------------------------- //
function get_array_char_printing_string__function_by_f_kromberg( ar, cha, nr_bool ) {
/* use:
var str = get_array_char_printing_string__function_by_f_kromberg(
ar = [ 1, 2, 3 ],
cha = ",",
nr_bool = true
);
*/
/* meta data:
tree: printing / 1 / parts / compilations / 3
tags: printing, array, char
info: get array + char
date: 2023-09-26
code: JS
test: ok
*/
var l = ar.length;
var i, j, el, cha_2;
var str = "";
for ( i=0; i<l; i++ ) {
j = i + 1;
el = ar[i];
if ( i > 0 ) cha_2 = cha + " "; // e.g. ", "
else cha_2 = "";
str += cha_2;
str += el;
if ( nr_bool ) str += " (" + j + ".)"; // e.g. "(1)"
} // for
return str;
} // function
function get_array_comma_printing_string__function_by_f_kromberg( ar, nr_bool ) {
/* use:
var str = get_array_comma_printing_string__function_by_f_kromberg(
ar = [ 1, 2, 3 ],
nr_bool = true
);
*/
/* meta data:
tree: printing / 1 / parts / compilations / 3
tags: printing, array, comma
info: get array + comma
date: 2023-09-26
code: JS
test: ok
*/
var l = ar.length;
var cha = ",";
var i, j, el, cha_2;
var str = "";
for ( i=0; i<l; i++ ) {
j = i + 1;
el = ar[i];
if ( i > 0 ) cha_2 = cha + " "; // e.g. ", "
else cha_2 = "";
str += cha_2;
str += el;
if ( nr_bool ) str += " (" + j + ".)"; // e.g. "(1)"
} // for
return str;
} // function
// --------- //
// ... / 2 //
// --------- //
// ------------------- //
// ... / ... / print //
// ------------------- //
// --------------------- //
// ... / ... / ... / 1 //
// --------------------- //
function print_text__procedure_by_f_kromberg( text ) {
/* use:
print_text__procedure_by_f_kromberg( text = "" );
*/
/* meta data:
tree: printing / 2 / print / 1
tags: printing, string
info: print text
date: 2023-09-26
code: JS
test: ok
*/
document.write( text );
} // function
// --------------------- //
// ... / ... / ... / 2 //
// --------------------- //
function print_br__procedure_by_f_kromberg() {
/* use:
var br = print_br__procedure_by_f_kromberg();
*/
/* meta data:
tree: printing / 2 / print / 2
tags: printing, string, br
info: print br
date: 2023-09-26
code: JS
test: ok
*/
var br = get_br__function_by_f_kromberg();
print_text__procedure_by_f_kromberg( br );
} // function
function print_n__procedure_by_f_kromberg() {
/* use:
print_n__procedure_by_f_kromberg();
*/
/* meta data:
tree: printing / 2 / print / 2
tags: printing, string, n
info: print n
date: 2023-09-26
code: JS
test: ok
*/
var n = get_n__function_by_f_kromberg();
print_text__procedure_by_f_kromberg( n );
} // function
// --------------------- //
// ... / ... / ... / 3 //
// --------------------- //
function print_text_br__procedure_by_f_kromberg( text ) {
/* use:
print_text_br__procedure_by_f_kromberg( text = "" );
*/
/* meta data:
tree: printing / 2 / print / 3
tags: printing, string, br
info: print text + br
date: 2023-09-26
code: JS
test: ok
*/
var str = get_text_br__function_by_f_kromberg( text );
print_text__procedure_by_f_kromberg( str );
} // function
function print_text_br_n__procedure_by_f_kromberg( text ) {
/* use:
print_text_br_n__procedure_by_f_kromberg( text = "" );
*/
/* meta data:
tree: printing / 2 / print / 3
tags: printing, string, br, n
info: print text + br + n
date: 2023-09-26
code: JS
test: ok
*/
var str = get_text_br_n__function_by_f_kromberg( text );
print_text__procedure_by_f_kromberg( str );
} // function
function print_text_n__procedure_by_f_kromberg( text ) {
/* use:
print_text_n__procedure_by_f_kromberg( text = "" );
*/
/* meta data:
tree: printing / 2 / print / 3
tags: printing, string, n
info: print text + n
date: 2023-09-26
code: JS
test: ok
*/
var str = get_text_n__function_by_f_kromberg( text );
print_text__procedure_by_f_kromberg( str );
} // function
// -------------------------------- //
// ... / ... / ... / compilations //
// -------------------------------- //
// --------------------------- //
// ... / ... / ... / ... / 1 //
// --------------------------- //
function print_array__procedure_by_f_kromberg( ar, nr_bool ) {
/* use:
print_array__procedure_by_f_kromberg(
ar = [ 1, 2, 3 ],
nr_bool = true
);
*/
/* meta data:
tree: printing / 2 / print / compilations / 1
tags: printing, array
info: print array
date: 2023-09-26
code: JS
test: ok
*/
var str = get_array_printing_string__function_by_f_kromberg( ar, nr_bool );
print_text__procedure_by_f_kromberg( str );
} // function
// --------------------------- //
// ... / ... / ... / ... / 2 //
// --------------------------- //
function print_array_br__procedure_by_f_kromberg( ar, nr_bool ) {
/* use:
print_array_br__procedure_by_f_kromberg(
ar = [ 1, 2, 3 ],
nr_bool = true
);
*/
/* meta data:
tree: printing / 2 / print / compilations / 2
tags: printing, array, br
info: print array + br
date: 2023-09-26
code: JS
test: ok
*/
var str = get_array_br_printing_string__function_by_f_kromberg( ar, nr_bool );
print_text__procedure_by_f_kromberg( str );
} // function
function print_array_br_n__procedure_by_f_kromberg( ar, nr_bool ) {
/* use:
print_array_br_n__procedure_by_f_kromberg(
ar = [ 1, 2, 3 ],
nr_bool = true
);
*/
/* meta data:
tree: printing / 2 / print / compilations / 2
tags: printing, array, br, n
info: print array + br + n
date: 2023-09-26
code: JS
test: ok
*/
var str = get_array_br_n_printing_string__function_by_f_kromberg( ar, nr_bool );
print_text__procedure_by_f_kromberg( str );
} // function
function print_array_n__procedure_by_f_kromberg( ar, nr_bool ) {
/* use:
print_array_n__procedure_by_f_kromberg(
ar = [ 1, 2, 3 ],
nr_bool = true
);
*/
/* meta data:
tree: printing / 2 / print / compilations / 2
tags: printing, array, n
info: print array + n
date: 2023-09-26
code: JS
test: ok
*/
var str = get_array_n_printing_string__function_by_f_kromberg( ar, nr_bool );
print_text__procedure_by_f_kromberg( str );
} // function
// --------------------------- //
// ... / ... / ... / ... / 3 //
// --------------------------- //
function print_array_char__procedure_by_f_kromberg( ar, cha, nr_bool ) {
/* use:
print_array_char__procedure_by_f_kromberg(
ar = [ 1, 2, 3 ],
cha = ",",
nr_bool = true
);
*/
/* meta data:
tree: printing / 2 / print / compilations / 3
tags: printing, array, char
info: print array + char
date: 2023-09-26
code: JS
test: ok
*/
var str = get_array_char_printing_string__function_by_f_kromberg( ar, cha, nr_bool );
print_text__procedure_by_f_kromberg( str );
} // function
function print_array_comma__procedure_by_f_kromberg( ar, nr_bool ) {
/* use:
print_array_comma__procedure_by_f_kromberg(
ar = [ 1, 2, 3 ],
nr_bool = true
);
*/
/* meta data:
tree: printing / 2 / print / compilations / 3
tags: printing, array, comma
info: print array + comma
date: 2023-09-26
code: JS
test: ok
*/
var str = get_array_comma_printing_string__function_by_f_kromberg( ar, nr_bool );
print_text__procedure_by_f_kromberg( str );
} // function
// --------------------------- //
// ... / ... / ... / ... / 4 //
// --------------------------- //
function print_array_std__procedure_by_f_kromberg( ar ) {
/* use:
print_array_std__procedure_by_f_kromberg( ar = [ 1, 2, 3 ] );
*/
/* meta data:
tree: printing / 2 / print / compilations / 4
tags: printing, array, std
info: print array std
date: 2023-09-26
code: JS
test: ok
*/
print_array_br_n__procedure_by_f_kromberg(
ar,
nr_bool = true
);
} // function
// --------- //
// ... / 3 //
// --------- //
// -------------------------- //
// ... / ... / print tables //
// -------------------------- //
function print_array_table__procedure_by_f_kromberg( ar, nr_bool ) {
/* use:
print_array_table__procedure_by_f_kromberg(
ar = [ 1, 2, 3 ],
nr_bool = true
);
*/
/* meta data:
tree: printing / 3 / print tables
tags: printing, array
info: print array
date: 2023-09-26
code: JS
test: ok
*/
var l = ar.length;
var i, j, el;
var str = "";
var n = get_n__function_by_f_kromberg();
str += "<table>" + n;
for ( i=0; i<l; i++ ) {
j = i + 1;
el = ar[i];
str += "<tr>" + n;
if ( nr_bool ) {
str += "<td>";
str += "<em>";
str += j + ".";
str += "</em>";
str += "</td>" + n;
} // if
str += "<td>";
str += el;
str += "</td>" + n;
str += "</tr>" + n;
} // for
str += "</table>" + n;
print_text__procedure_by_f_kromberg( str );
} // function
function get_length_of_array__function_by_f_kromberg(_){return _.length}function get_id_of_last_element_of_array__function_by_f_kromberg(_){return get_length_of_array__function_by_f_kromberg(_)-1}function get_id_of_new_element_of_array__function_by_f_kromberg(_){return get_id_of_last_element_of_array__function_by_f_kromberg(_)+1}function push_elements_of_array_forward__function_by_f_kromberg(_,r,n){var e=get_id_of_last_element_of_array__function_by_f_kromberg(_)-1;n>e&&(n=e);var t,o,f=r+1;for(t=n+1;t>=f;t--)o=_[t-1],_[t]=o;return _[r]=null,_}function push_elements_of_array_backward__function_by_f_kromberg(_,r,n){r<1&&(r=1);var e,t,o=n-1;for(e=r-1;e<=o;e++)t=_[e+1],_[e]=t;return _[n]=null,_}function push_elements_of_array_forward_from_id_to_end__function_by_f_kromberg(_,r){return _=push_elements_of_array_forward__function_by_f_kromberg(_,r,get_id_of_last_element_of_array__function_by_f_kromberg(_))}function push_elements_of_array_forward_from_start_to_id__function_by_f_kromberg(_,r){return _=push_elements_of_array_forward__function_by_f_kromberg(_,0,r)}function push_elements_of_array_backward_from_id_to_end__function_by_f_kromberg(_,r){return _=push_elements_of_array_backward__function_by_f_kromberg(_,r,get_id_of_last_element_of_array__function_by_f_kromberg(_))}function push_elements_of_array_backward_from_start_to_id__function_by_f_kromberg(_,r){return _=push_elements_of_array_backward__function_by_f_kromberg(_,0,r)}function add_element_to_array__function_by_f_kromberg(_,r){return _[get_id_of_new_element_of_array__function_by_f_kromberg(_)]=r,_}function remove_last_element_of_array__function_by_f_kromberg(_){return _.pop(),_}function add_element_anywhere_in_array__function_by_f_kromberg(_,r,n){return(_=push_elements_of_array_forward_from_id_to_end__function_by_f_kromberg(_=add_element_to_array__function_by_f_kromberg(_,null),r))[r]=n,_}function remove_any_element_of_array__function_by_f_kromberg(_,r){return remove_last_element_of_array__function_by_f_kromberg(_=push_elements_of_array_backward_from_id_to_end__function_by_f_kromberg(_,r+1)),_}function add_element_as_first_element_of_array__function_by_f_kromberg(_,r){return _=add_element_anywhere_in_array__function_by_f_kromberg(_,id=0,r)}function remove_first_element_of_array__function_by_f_kromberg(_){return _=remove_any_element_of_array__function_by_f_kromberg(_,id=0)}function readme_rectangular_cuboid__readme_by_f_kromberg(){}function get_lateral_area_of_rectangular_cuboid__function_by_f_kromberg(_,r,n){return 2*(_+r)*n}function get_lateral_area_plus_top_surface_of_rectangular_cuboid__function_by_f_kromberg(_,r,n){return 2*(_+r)*n+_*r}function get_surface_of_rectangular_cuboid__function_by_f_kromberg(_,r,n){return 2*(_*r+_*n+r*n)}function get_volume_of_rectangular_cuboid__function_by_f_kromberg(_,r,n){return _*r*n}function get_br__function_by_f_kromberg(){return"<br>"}function get_n__function_by_f_kromberg(){return"\n"}function get_text_br__function_by_f_kromberg(_){return _+get_br__function_by_f_kromberg()}function get_text_br_n__function_by_f_kromberg(_){var r=get_text_br__function_by_f_kromberg(_);return r+=get_n__function_by_f_kromberg()}function get_text_n__function_by_f_kromberg(_){return _+get_n__function_by_f_kromberg()}function get_array_printing_string__function_by_f_kromberg(_,r){var n,e=_.length,t="";for(n=0;n<e;n++)r&&(t+=n+1+": "),t+=_[n];return t}function get_array_br_n_printing_string__function_by_f_kromberg(_,r){var n,e=_.length,t="",o=get_br__function_by_f_kromberg(),f=get_n__function_by_f_kromberg();for(n=0;n<e;n++)r&&(t+=n+1+": "),t+=_[n]+o+f;return t}function get_array_br_printing_string__function_by_f_kromberg(_,r){var n,e=_.length,t="",o=get_br__function_by_f_kromberg();for(n=0;n<e;n++)r&&(t+=n+1+": "),t+=_[n]+o;return t}function get_array_n_printing_string__function_by_f_kromberg(_,r){var n,e=_.length,t="",o=get_n__function_by_f_kromberg();for(n=0;n<e;n++)r&&(t+=n+1+": "),t+=_[n]+o;return t}function get_array_char_printing_string__function_by_f_kromberg(_,r,n){var e,t,o=_.length,f="";for(e=0;e<o;e++)t=e+1,f+=e>0?r+" ":"",f+=_[e],n&&(f+=" ("+t+".)");return f}function get_array_comma_printing_string__function_by_f_kromberg(_,r){var n,e,t=_.length,o="";for(n=0;n<t;n++)e=n+1,o+=n>0?", ":"",o+=_[n],r&&(o+=" ("+e+".)");return o}function print_text__procedure_by_f_kromberg(_){document.write(_)}function print_br__procedure_by_f_kromberg(){print_text__procedure_by_f_kromberg(get_br__function_by_f_kromberg())}function print_n__procedure_by_f_kromberg(){print_text__procedure_by_f_kromberg(get_n__function_by_f_kromberg())}function print_text_br__procedure_by_f_kromberg(_){print_text__procedure_by_f_kromberg(get_text_br__function_by_f_kromberg(_))}function print_text_br_n__procedure_by_f_kromberg(_){print_text__procedure_by_f_kromberg(get_text_br_n__function_by_f_kromberg(_))}function print_text_n__procedure_by_f_kromberg(_){print_text__procedure_by_f_kromberg(get_text_n__function_by_f_kromberg(_))}function print_array__procedure_by_f_kromberg(_,r){print_text__procedure_by_f_kromberg(get_array_printing_string__function_by_f_kromberg(_,r))}function print_array_br__procedure_by_f_kromberg(_,r){print_text__procedure_by_f_kromberg(get_array_br_printing_string__function_by_f_kromberg(_,r))}function print_array_br_n__procedure_by_f_kromberg(_,r){print_text__procedure_by_f_kromberg(get_array_br_n_printing_string__function_by_f_kromberg(_,r))}function print_array_n__procedure_by_f_kromberg(_,r){print_text__procedure_by_f_kromberg(get_array_n_printing_string__function_by_f_kromberg(_,r))}function print_array_char__procedure_by_f_kromberg(_,r,n){print_text__procedure_by_f_kromberg(get_array_char_printing_string__function_by_f_kromberg(_,r,n))}function print_array_comma__procedure_by_f_kromberg(_,r){print_text__procedure_by_f_kromberg(get_array_comma_printing_string__function_by_f_kromberg(_,r))}function print_array_std__procedure_by_f_kromberg(_){print_array_br_n__procedure_by_f_kromberg(_,nr_bool=!0)}function print_array_table__procedure_by_f_kromberg(_,r){var n,e=_.length,t="",o=get_n__function_by_f_kromberg();for(t+="<table>"+o,n=0;n<e;n++)t+="<tr>"+o,r&&(t+="<td>",t+="<em>",t+=n+1+".",t+="</em>",t+="</td>"+o),t+="<td>",t+=_[n],t+="</td>"+o,t+="</tr>"+o;print_text__procedure_by_f_kromberg(t+="</table>"+o)}