This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { type DependencyList } from "react"; | |
export interface Atom<Value> extends Readonly<{ | |
id: string; | |
get(): Value; | |
set(value: Value): void; | |
sub(cb: SubFn<Value>): Unsub; | |
}> { | |
} | |
export type SubFn<Value> = (value: Value) => void; | |
export type Unsub = () => void; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useRef, useState } from "react"; | |
let atomCount = 0; | |
export function atom(initialValue) { | |
let value = initialValue; | |
let subs = []; | |
let id = `atom${atomCount++}`; | |
return Object.freeze({ | |
id, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def generar_numero_secreto(): | |
while True: | |
numero_secreto = random.randint(100, 999) # Asegura un número de tres dígitos. | |
s = str(numero_secreto) | |
if s[0] != s[1] and s[1] != s[2] and s[0] != s[2]: # Verifica dígitos diferentes. | |
return numero_secreto | |
def evaluar_intento(intento, secreto): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def generar_numero_secreto(): | |
while True: | |
numero_secreto = random.randint(100, 999) # Asegura un número de tres dígitos. | |
s = str(numero_secreto) | |
if s[0] != s[1] and s[1] != s[2] and s[0] != s[2]: # Verifica dígitos diferentes. | |
return numero_secreto | |
def evaluar_intento(intento, secreto): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use client' | |
import { useCreatorsStore } from 'components/admin/creators/creators-store' | |
export default function MoreInfoModal() { | |
const { creatorData } = useCreatorsStore() | |
return ( | |
...component logic |