Skip to content

Instantly share code, notes, and snippets.

@Linaryx
Linaryx / numtotext.js
Last active September 15, 2024 21:12
function decodeString(encodedStr) {
let decoded = '', word = '';
for (let i = 0; i < encodedStr.length; i++) {
const char = encodedStr[i];
if (!isNaN(char)) {
word += String.fromCharCode(parseInt(char) + 64);
} else if (char === ' ') {
decoded += word + ' ';
word = '';
function getRandElement(elements) {
return elements[Math.floor(Math.random() * elements.length)];
}
function r() {
return getRandElement(["pozhar", "POTOP", "POTOM"]);
}
function generateMessage() {
const results = [r(), r(), r(), r()];
@Linaryx
Linaryx / morkovka.js
Last active May 12, 2025 05:42
Functionality of a slot machine in the form of javascript code from the series of Smeshariki “Bolshoi Kush”
const gambleEmotes = ["GAMBA", "catGAMBLING", "IVEPLAYEDTHESEGAMESBEFORE", "Loodomanych", "Opachki"];
const symbols = ["🥕", "🍒", "🔔", "❌"];
let availableEmotes = [];
function loadEmotes() {
return new Promise((resolve, reject) => {
utils.fetchEmotes().then(emotes => {
const emoteNames = Object.values(emotes).map(emote => emote.name);
availableEmotes = gambleEmotes.filter(emote => emoteNames.includes(emote));
resolve();