Skip to content

Instantly share code, notes, and snippets.

View Lumexio's full-sized avatar
🧙‍♂️
Vibing

Francisco Salazar Lumexio

🧙‍♂️
Vibing
View GitHub Profile
@Lumexio
Lumexio / Conway's Game of Life.py
Created October 21, 2025 02:52
Conway's Game of Life (revisited) on an 8x8 toroidal board.
#!/usr/bin/env python3
"""
Conway's Game of Life (revisited) on an 8x8 toroidal board.
- Toroidal wrap-around: top↔bottom and left↔right edges are connected.
- Uses the corrected initial configuration provided by you.
- Prints the initial board + next 3 generations (4 total).
"""
SIZE = 8 # 8x8 board
@Lumexio
Lumexio / countChar.js
Created August 17, 2025 20:41
Str character counter
function countLetter(str){
let transStr=str.split('');
let count=0;
let r='';
let currChar=transStr[0];
for(let i=0;i<=transStr.length;i++){
let c=transStr[i];
if(c!=currChar){
r+=`${currChar}${count}`;
@Lumexio
Lumexio / SingleLinkedList.js
Created August 13, 2025 00:19
Single linked list implementation
class Node {
constructor(data) {
this.data = data;
this.link = null;
}
}
class SingleLinkedList {
constructor() {
this.head = null;
this.tail = null;
@Lumexio
Lumexio / linkedList.js
Created August 12, 2025 03:00
Linked list
class Node {
constructor(data) {
this.prev = null;
this.data = data;
this.next = null;
}
}
class linkedList {
constructor() {
@Lumexio
Lumexio / vowelsPattern.js
Created June 19, 2025 23:06
Check pattern vowels check
const pattern = "010";
const source = "amazing";
function patternSourceMatch(pattern, source) {
let resp = "";
const vowels = new Set(["a", "e", "i", "o", "u", "y"]);
// Convert source to binary string based on vowels/consonants
for (let char of source) {
resp += vowels.has(char) ? "0" : "1";
@Lumexio
Lumexio / arrayTransformation.js
Created June 19, 2025 23:05
Array transformation
function transformArray(a) {
const b = [];
for (let i = 0; i < a.length; i++) {
const left = a[i - 1] ?? 0;
const current = a[i] ?? 0;
const right = a[i + 1] ?? 0;
b.push(left + current + right);
}
@Lumexio
Lumexio / triangle.js
Created June 17, 2025 08:26
Inverted triangle script
// your code goes here
for(let i=5;i>=0;i--){
let row='';
for(let j=0;j<i;j++){
row+=j
}
console.log(row);
}
@Lumexio
Lumexio / pairsCount.main
Created January 21, 2023 02:18
Pair Count
function countPairs(ar) {
var obj = {};
ar.forEach(item => {
obj[item] = obj[item] ? obj[item] + 1 : 1;
});
return Object.values(obj).reduce((acc, curr) => {
acc += Math.floor(curr / 2)
return acc;
@Lumexio
Lumexio / multiplyAlternate.js
Last active January 19, 2023 07:48
Multiply without "*"
process.stdin.resume();
process.stdin.setEncoding('utf8');
// Your code here!
function multiply(a, b) {
return a / (1 / b);
}
console.log(multiply(2,3));
@Lumexio
Lumexio / reverseString.js
Last active January 19, 2023 17:02
Reverse string
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.resume();
process.stdin.setEncoding('utf8');
// Function to reverse string
// function ReverseString(str) {
// return str.split('').reverse().join('')
// }