We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import * as mo from "movy"; const gridSize = [21, 12]; mo.enableMotionBlur(); let n = 1; for (let i = 1; i < gridSize[1]; i++) { for (let j = 1; j < gridSize[0]; j++) { const prime = isPrime(n); const position = [j, -i]; mo.addText(n.toString(), { position: position.concat([0]), scale: 0.3, color: "white", }); mo.addRectOutline({ position, lineWidth: 0.03 }); if (prime) { mo.addRect({ position: position.concat([0.01]), color: "#fad390" }).grow2({ t: "<0.1", }); mo.addText(n.toString(), { position: position.concat([0.02]), scale: 0.3, color: "black" }).grow2({ t: "<0.1", }); } n++; } } mo.cameraMoveTo({ position: [3, -3, 5], rx: 0.2, duration: 0, t: 0 }); mo.cameraMoveTo({ position: [gridSize[0] * 0.5, -gridSize[1] * 0.5, 10], rx: 0, t: "<", duration: 10, }); mo.run(); function isPrime(num) { for (let i = 2, s = Math.sqrt(num); i <= s; i++) if (num % i === 0) return false; return num > 1; }
改成这样?不然一开始不会显示质数,有点水(
The text was updated successfully, but these errors were encountered:
No branches or pull requests
改成这样?不然一开始不会显示质数,有点水(
The text was updated successfully, but these errors were encountered: