/
izida
/
my_algorithms
Обзор
Документация
Войти
/
izida
/
my_algorithms
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
main.html
15 строк
476 B
Никита Бурковский
take dis all
19 мар 2024, 14:14
19 мар 2024, 14:14
5dd6589
Код
Авторство
О чём код?
<!DOCTYPE html> <script>function heartShape(msg = "Merry Christmas") { let lines = []; for (let y = 15; y > -15; y--) { let line = ""; for (let x = -30; x < 30; x++) { let f = Math.pow((Math.pow(x * 0.05, 2) + Math.pow(y * 0.1, 2) - 1), 3) - Math.pow(x * 0.05, 2) * Math.pow(y * 0.1, 3); line += f <= 0 ? msg[(x - y) % msg.length] : " "; } lines.push(line); } console.log(lines.join("\n")); } heartShape();</script>