Answers:
LBL 1
RAND4-2->X
RAND4-2
IF (X²+ANS²-1)³<X²ANS³
PT-ON(X,ANS
GOTO 1
这花了一段时间,我的电池电量很低,所以我不想继续走下去。
我尝试使用第二个方程式,但实际上无法使用它,因此实际上更长了,因此我只修改了另一个答案。
编辑:我刚刚注意到50x50像素的要求,不幸的是屏幕只有47像素高,所以这是不可能的。
IF (X²+ANS²-1)³-X²ANS³<0
为IF (X²+ANS²-1)³<X²ANS³
吗?
$y=1-$_/25,say+map$y**3*($_*=$_/1e3)-($_+$y**2-1)**3>0?$|--?v60:3:$",-40..40for-6..50
用运行perl -E
。
使用第一个方程式绘制填充的ASCII心脏。请注意,x轴拉伸了约1.265倍:这是为了抵消以下事实:终端字体通常在垂直方向上比水平方向上要大得多。
输出:
3<3<3<3<3<3<3< 3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3< 3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3< 3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3< 3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3< 3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3 <3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<
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<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3<3<3<3<3
<3<3<3<3<3<3<3<3<3<
3<3<3<3<3<3<3<3
<3<3<3<3<3<
3<3<3<3
<3<3<
3
说明(由于OP要求提供):
condition := $y**3*($_*=$_/1e3)-($_+$y**2-1)**3>0
这只是第一个方程式,稍作重新排列使其更短。$ y直接表示公式中的y。$ _最初与x成比例,但与自身($_*=$_/1e3
)乘以赋值,使其与x²成比例。由于x²在公式中使用了两次,因此节省了一些字节。
1e3
意味着1000,并被选中,因为它很短,结果看起来不错。**
是Perl的电源操作员。我使用>0
而不是==0
因为我想要一颗饱满的心。
flip_flop := $|--?v60:3
v60滥用了古老的版本字符串语法来表示ASCII码为60的字符:“ <”。
$ | 是一个魔术变量,只能为0或1。当减为0时,将其设置为1。减为1时,自然将其设置为0。因此,$ |-通常用作触发器:每次经过评估,它在true和false之间交替。
总体而言,此表达式交替返回'<'和3。
inner_loop := <condition> ? <flip_flop> :$"
嵌套的三元。如果条件为假(→我们在心脏外面),则求值为$“,这是一个默认为”“(单个空格)的神奇变量。如果条件为真(→我们在心脏内部),则它为评估flip_flop。
outer_loop := say+map <inner_loop> ,-40..40
反复评估inner_loop,将$ _(Perl的“默认”变量)从-40变为40,以1为增量。它将这些评估的结果收集到一个临时列表中,然后将它们全部打印出来,并以新行结尾。
$y=1-$_/25, <outer_loop> for-6..50
这会重复运行external_loop,其中$ y从1.24(1-(-6 / 25))到-1(1-50/25),减量为0.04。
请注意,y除以25,而x²除以1000,这与x除以sqrt(1000)相同。我提到的〜1.265因子是sqrt(1000)/ 25。
感谢Martin Ender削减了2个字节(第一个心脏曲线->心脏曲线1)
多亏了Martin Ender(心曲线1-> heartcurve1),再减少了2个字节
这可能是作弊(显而易见的解决方案),但是这里有。
heartcurve1
我敢肯定有一种方法可以缩短第一,心脏或曲线,使Wolfram仍然接受。好吧,现在没有空间了,也许是心脏的某种缩写?
绘制其中2张,我会获得奖励积分吗?
heartcurves
heart curve 1
heartcurve1
可行。
RegionPlot[(x^2+y^2-1)^3-x^2y^3<0,{x,-2,2},{y,-2,2}]
我们可以再保存一个字节,ContourPlot
但是背景有点混乱:
ContourPlot[(x^2+y^2-1)^3-x^2y^3,{x,-2,2},{y,-2,2}]
对于另外一个字节,我们可以使用第四个公式,PolarPlot
而不是:
PolarPlot[(x=Sin@t)Abs@Cos@t^.5/(x+7/5)-2x+2,{t,0,7}]
V 2:
xx).3 y = xx + yy-1
(= xx)^.3y=xx+yy-1
)
V 1:
xx + yy-1)3 = xxy 3
V 0:
(x2+y2-1)3=x2y3
xx
,而不是x^2
polar_plot(sin(x)*abs(cos(x))^.5/(sin(x)+7/5)-2*sin(x)+2,(0,2*pi))
不幸的是,implicit_plot
and 的长名称parametric_plot
(加上需要x
为前者隐式定义的变量之外的其他变量)的定义使前三个选项的时间太长,无法考虑。
感谢busukxuan和Andrea Lazzarotto的帮助
^.5
到位的工作**.5
?
^
是XOR。
^
与**
。我想知道是否是因为后面跟着a.
**
)。如果尝试使用^
,最终会得到警告和错误的结果。
p;float x,y,f;v(){for(p=4e3;p;x=(float)(p%99-50)/35,y=(float)(p/40-45)/40,f=x*x+y*y-1)putchar(p--%99?f*f*f-x*x*y*y*y<1e-3?35:32:10);}
感谢@AlbertRenshaw,我还将100s更改为99s,以获得另外2个字节
v
为功能使用,才华横溢。您可以通过更换刮胡子两个字节4000
与4e3
和更换0.001
用1e-3
*3×
²+’*3<çị⁾*
25µNr÷21µ²ç@þUY
或35个字节用♥
,而不是*
填充:改变中间线²+’*3<ç×9829Ọ»⁶
。
♥♥♥♥♥♥♥♥♥♥ ♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥ ♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥ ♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥♥♥
♥♥♥♥♥♥♥
♥♥♥
♥
*3× - Link 1: y, xSquared
*3 - cube y
× - multiply the result by xSquared
²+’*3<çị⁾* - Link 2: y, xSquared
² - square y
+ - add xSquared to the result
’ - subtract one
*3 - cube the result
< - less than? (1 if True, 0 if False)
ç - the result of the last link (1) as a dyad: f(y, xSquared)
ị - index into (1-based):
⁾* - the string "* " (there is a trailing space on this line)
×9829Ọ»⁶ - alternative ending of link 2
×9829 - multiply (vectorises) by 9829
Ọ - cast to character (vectorises) (9829 is the ♥, 0 is the null-byte)
» - maximum (vectorises) of that and:
⁶ - space character (ordinal of space is 32, greater than the null-byte, less than ♥)
25µNr÷21µ²ç@þUY - Main link: no arguments
25 - 25
µ - monadic chain separation call that i
N - negate i
r - inclusive range(negated i, i) -> [-25, -24, ..., 24, 25]
÷21 - divide by 21 (vectorises) -> [-1.1904761904761905, -1.1428571428571428, ..., 1.1428571428571428, 1.1904761904761905]
µ - monadic chain separation call that r
² - square r (vectorises) (make the xSquared values, left to right)
U - upend r (make the y values, top to bottom)
þ - outer product using:
ç@ - last link (2) as a dyad with reversed arguments: f(y, xSquared)
Y - join with line feeds
- implicit print
document.write`<canvas id=c>`;for(i=0;x=2-i/24,i<97;i++)for(j=0;y=2-j/24,z=x*x+y*y-1,j<97;j++)z*z*z-x*x*y*y*y<0&&c.getContext`2d`.fillRect(i,j,1,1)
编辑:由于@ user2428118,节省了4个字节。143字节的ES7版本:
document.write`<canvas id=c>`;for(i=0;i<97;i++)for(x=2-i/24,j=0;j<97;j++)x*x*(y=2-j/24)**3-(x*x+y*y-1)**3>0&&c.getContext`2d`.fillRect(i,j,1,1)
y**3
,而不是y*y*y
?
明天将打高尔夫球。
在http://www.bbcbasic.co.uk/bbcwin/bbcwin.html下载口译员
ORIGIN99,99F.u=-56TO56x=u/50b=x^2^.33/2r=(b^2-x^2+1)^.5*50L.u,b*50-r,u,r+b*50N.
使用第一个方程式绘制一个填充的心,我们重新排列并获取的立方根(存在3个实数的立方根,一个实数和2个复数,但在这里我们只对实数根感兴趣。)然后,我们再次重新排列为得到二次方 y
x^2+y^2-1=(x^0.66)y
y^2-(x^0.66)y+x^2-1=0
对类型的表达式使用标准的二次公式ay^2+by+c=0
,并利用a
= 1 的事实,我们得到
y = -b/2 +/- sqrt((b/2)^2-c)
y = -b/2 +/- sqrt((b/2)^2-x^2+1)
位置-b/2 = (x^0.66)/2
(b
在程序中由表示)。
我们只需x
从左到右扫描值,在每对有效值之间绘制一条垂直线y
以建立一个实心形状。
ORIGIN99,99F.u=-56TO56x=u/50b=x^2^.33/2r=(b^2-x^2+1)^.5*50L.u,b*50-r,u,r+b*50N.
不打高尔夫球
ORIGIN99,99
FORu=-56TO56
x=u/50
b=x^2^.33/2
r=(b^2-x^2+1)^.5*50
LINEu,b*50+r,u,b*50-r
NEXT
给露比一些爱。
-2.step(2,0.2){|y|-2.step(2,0.1){|x|$><<'. O'[(y*y-1+x*=x)**3+x*y**3<=>0]};puts}
OOOOO OOOOO
.OOOOOOOOO.OOOOOOOOO.
OOOOOOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOOOOOOO
.OOOOOOOOOOOOOOOOOOO.
OOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOO
OOOOOOOOOOO
OOOOO
.
上下有一些空行
松散:
t = 0;
void setup() {
size(99, 300);
}
void draw() {
point(59+99*sin(t)*cos(t)*log(t),350-400*sqrt(cos(t))*pow(t,0.3));
t+=0.01;
}
打高尔夫球:
t=0;void setup(){size(99,300);}void draw(){point(59+99*sin(t)*cos(t)*log(t),350-400*sqrt(cos(t))*pow(t,0.3));t+=0.01;}
这是一个非常骗人的工具,因为它从0到无穷远绘制了#2,而不是如图-1所示从-1到1来保存两个abs(t)。但这在技术上是正确的,因为有100多个点。
130字节的“纠正者”之一
t=-1;void setup(){size(99,300);}void draw(){point(59+99*sin(t)*cos(t)*log(abs(t)),350-400*sqrt(cos(t))*pow(abs(t),0.3));t+=0.01;}
注意:可能有一种方法可以在默认的100x100画布上获得100分并清除设置。
float
的,而不是int
类似于@ 12Me21的答案和输出,但适用于TI-83 / 84系列。
While 1:2rand-1→A:2rand-1:If (A²+Ans²-1)³>A²Ans³:Pt-On(A,Ans:End
这是Level River Street 答案的一种变体,但仅适用于BBC Micro最初对BBC BASIC的迭代。
您可以在https://bbc.godbolt.org/(基于JavaScript的BBC Micro仿真器)上将以下任意一项复制并粘贴到JSBeeb的新粘贴功能中,一旦粘贴完成,请在“屏幕”中按Enter以显示新的提示,然后键入RUN,然后按Enter以运行任一版本。
打高尔夫球。(126字节)
1MO.1:V.29,64;64;:MOVE-57,20:GC.0,1:F.U=-56TO56:X=U/50:IFX<>0TH.B=X^2^.33/2
2R=(B^2-X^2+1)^.5*50:DRAWU,B*50+R:DRAW U,B*50-R:N.
不打高尔夫球。(176字节)
1 MODE 1
2 VDU 29,64;64;
3 MOVE -57,20
4 GCOL 0,1
5 FOR U = -56 TO 56
6 X = U/50
7 IF X <> 0 THEN B = X^2^.33/2
8 R = (B^2-X^2+1)^.5*50
9 DRAW U,B*50+R
10 DRAW U,B*50-R
11 NEXT
第7行要求对X进行检查,以防止在循环中途X变为0时出现“对数范围”错误。除此之外,几乎是相同的。在JSBeeb很好地模拟的真实机器上绘制要慢得多。