Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const RADIUS = 60; // Circle radius
- const charsToFind = ['e', '█', 'r', 'D'];
- const charToReplaceWith = ' ';
- const cx = Number(cursor.x);
- const cy = Number(cursor.y);
- for (let x = cx - RADIUS; x <= cx + RADIUS; x++) {
- for (let y = cy - RADIUS; y <= cy + RADIUS; y++) {
- // Check if the point is within the circle
- const dx = x - cx;
- const dy = y - cy;
- if (dx * dx + dy * dy <= RADIUS * RADIUS) {
- const info = getCharInfoXY(x, y);
- if (charsToFind.includes(info.char) && !info.deco.bold) {
- writeCharAt(
- charToReplaceWith,
- prsFmt({ color: info.color, bold: false }),
- x,
- y
- );
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment