2023-04-09 05:35:35 +00:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2022-04-14 10:22:00 +00:00
|
|
|
.pragma library
|
|
|
|
|
|
|
|
function convertNumber(number) {
|
2022-04-30 07:27:56 +00:00
|
|
|
if (number === 1)
|
|
|
|
return "A";
|
|
|
|
if (number >= 2 && number <= 10)
|
|
|
|
return number;
|
|
|
|
if (number >= 11 && number <= 13) {
|
|
|
|
const strs = ["J", "Q", "K"];
|
|
|
|
return strs[number - 11];
|
|
|
|
}
|
|
|
|
return "";
|
2022-04-14 10:22:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Array.prototype.contains = function(element) {
|
2022-04-30 07:27:56 +00:00
|
|
|
return this.indexOf(element) != -1;
|
2022-04-14 10:22:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Array.prototype.prepend = function() {
|
2022-04-30 07:27:56 +00:00
|
|
|
this.splice(0, 0, ...arguments);
|
2022-04-14 10:22:00 +00:00
|
|
|
}
|