Perl, 86 bayt
$y=1-$_/25,say+map$y**3*($_*=$_/1e3)-($_+$y**2-1)**3>0?$|--?v60:3:$",-40..40for-6..50
İle koş perl -E
.
İlk denklemi kullanarak doldurulmuş bir ASCII kalbini çizer. X ekseninin ~ 1.265 faktörü ile gerildiğine dikkat edin: bu terminal yazı tiplerinin genellikle yatay olarak dikey olarak çok daha büyük olduğu gerçeğini engellemektir.
Çıktı:
3<3<3<3<3<3<3< 3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3< 3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3< 3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3< 3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3< 3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3 <3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<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<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3
<3<3<3<3<3<
3<3<3<3
<3<3<
3
Açıklama (OP bunu istediğinden beri):
condition := $y**3*($_*=$_/1e3)-($_+$y**2-1)**3>0
Bu, basitçe kısaltmak için yeniden düzenlenmiş ilk denklemdir. $ y doğrudan formülde y'yi temsil eder. $ _ başlangıçta x ile orantılıdır, ancak $_*=$_/1e3
x² ile orantılı olmasını sağlayarak kendisi ile ( ) çarpılır . X², formülde iki kez kullanıldığından, birkaç bayttan tasarruf sağlar.
1e3
1000 demektir ve kısa seçildi ve sonuç iyi görünüyordu. **
Perl'in güç operatörü. Kullandığım >0
yerine ==0
bir dolu kalbini istiyorum çünkü.
flip_flop := $|--?v60:3
v60, ASCII kod 60: '<' ile karakteri göstermek için eski sürüm dizgisi sözdiziminin kötüye kullanılmasıdır.
$ | sadece 0 veya 1 olabilen büyülü bir değişkendir. Zaten 0'a ayarlandığında azalarak 1 olarak ayarlanır. 1 olarak azaldığında doğal olarak 0'a ayarlanır. Böylece, $ | - genellikle flip-flop olarak kullanılır: değerlendirildi, doğru ve yanlış arasında değişiyor.
Genel olarak, bu ifade alternatif olarak '<' ve 3 değerini döndürür.
inner_loop := <condition> ? <flip_flop> :$"
İç içe üçlüler. Koşul yanlışsa (→ kalbin dışındayız), "" olarak varsayılan olan sihirli bir değişken olan $ "olarak değerlendirilir (tek boşluk). Koşul doğruysa (→ kalbin içindeyiz) flip_flop'u değerlendirir.
outer_loop := say+map <inner_loop> ,-40..40
$ _ (Perl'in “varsayılan” değişkeni) -40'dan 40'a kadar olan $ 1 (perl'in “varsayılan” değişkeni) 1 artışlarla tekrar tekrar inner_loop'u değerlendirir. .
$y=1-$_/25, <outer_loop> for-6..50
Bu, outer_loop öğesini art arda çalıştırır ve $ y, 0,04 azalışlarla 1,24 (1 - (-6 / 25)) ile -1 (1 - 50/25) arasındadır.
Y'nin 25'e, x²'nin 1000'e bölündüğünü ve bunun x'in sqrt'e (1000) bölünmesiyle aynı olduğuna dikkat edin. Bahsettiğim ~ 1.265 faktörü sqrt (1000) / 25'dir.