№6358
DOLLLLLLLLLLLLLLLL ADD COPDE TAGS
section .text
extern printf
global main
main:
push ebp
mov ebp, esp
xor ebx, ebx; i
.loop:
inc bl
cmp bl, 100; max
jge .exit
mov al, bl
aam 3
jnz .fif
; &&
mov al, bl
aam 5
jnz .fif
push fizzbuzz
jmp .print
.fif:
mov al, bl
aam 3
jnz .sif
push fizz
jmp .print
.sif:
mov al, bl
aam 5
jnz .tif
push buzz
jmp .print
.tif:
push ebx
push nil
jmp .print
.exit:
mov esp, ebp
leave
ret
.print:;duplicate code removal
call printf
jmp .loop
section .data
nil:db'%d',13,10,0
fizz:db'fizz',13,10,0
buzz:db'buzz',13,10,0
fizzbuzz:db'fizzbuzz',13,10,0
№6542
DOOOOOOOOOOOOOOOOOOOOLL ADD CODE TAGS
it works!
section .text
extern printf, scanf
global main
main:
push ebp
mov ebp, esp
sub esp, 8
push str_option
call printf
add esp, 4
lea eax, [ebp - 4]
push eax
push str_num
call scanf
add esp, 8
push str_input
call printf
add esp, 4
lea eax, [ebp - 8]
push eax
push str_num
call scanf
add esp, 8
mov eax, [ebp - 4]
and eax, 1
jnz .toFahrenheit
.toCelsius:
fild dword [ebp - 8]
fild dword [thirtyTwo]
fsub
fld dword [fiveNineths]
fdiv
fist dword [ebp - 8]
jmp .printResult
.toFahrenheit:
fild dword [thirtyTwo]
fld dword [fiveNineths]
fild dword [ebp - 8]
fmul
fadd
fist dword [ebp - 8]
.printResult:
push dword [ebp - 8]
push str_format_result
call printf
xor eax, eax
add esp, 16
pop ebp
mov esp, ebp
leave
ret
section .data
fiveNineths: dd 1.8
thirtyTwo: dd 32
str_option: db '[0]toCelsius, [1]toFahrenheit: ', 0
str_input: db 'input temperature: ', 0
str_format_result: db 'Result: %d',13,10,0
str_num: db '%d', 0
№7480
still need to de-minify it, but it works as a great space heater lmao
>int x;float y,v,z,i,a=acos(-1.);float s(float x,float y){return clamp( iTime-x,0.,y)/y;}vec3 m,l;vec4 f,c,e,d;mat2 s(float x){return mat2(cos(x),sin(x),-sin(x),cos(x));}vec3 n,w;vec2 s(vec3 x,float z,int m){vec2 v,f=vec2(length(x)-2.,5);f.x=max(abs(f.x)-.2,abs(x.y)-1.);v=vec2(length(x)-2.,3);v.x=max(abs(v.x)-.1,abs(x.y)-1.2);v.x=min(v.x,length(x.xz)-z);v.x=min(v.x,length(x.xy)-z*(1.+e.y-abs(x.z*(.15-.05*i))));f=f.x<v.x?f:v;v=vec2(length(abs(x)-vec3(0,1,0))-1.2,6);v.x=max(abs(v.x)-.1,abs(x.y)-1.9);if(length(l)>.9)n[m]+=.1/(.1+v.x*v.x*(100.-sin(l.y*l.z*.02-y*2.*a/.9376)*99.*w.x));f=f.x<v.x?f:v;v=vec2(length(abs(x)-vec3(0,1,0))-1.2,5);v.x=max(abs(v.x)-.05,abs(x.y)-2.);f=f.x<v.x?f:v;v=vec2(length(x.xz)-2.5,6);v.x=max(abs(v.x)-.1,abs(x.y)-.5);f=f.x<v.x?f:v;f.x*=.7;return f;}vec2 p(vec3 m){l=m;if(x>5){if(x>7)m.xy*=s(sin(m.z*.1+y)*.3),m.z=mod(m.z+y*-10.,40.)-20.;else m.y+=sin(m.z*.1+y*e.z)*4.,m.z=mod(m.z+y*10.*e.z,48.)-24.,m=m.xzy,v=m.z;}vec4 a=vec4(m,1)*.3;a.xy*=s(c.x);for(int i=0;i<int(f.z);i++)a.xy*=s(.785*c.y),a.xyz=abs(a.xyz)-vec3(f.y,0,0),a=a*1.3/clamp(dot(a.xyz,a.xyz),.17,.95);vec2 i,d=s(mix(a.xzy,a.xyz,c.y-e.x),f.w,0);d.x/=a.w;if(x>3)d.x=max(d.x,-(length(m.xy)-.2));m.xy*=s(.785*c.y+c.x);i=s(abs(m*.3)-vec3(0,f.x,0),.1,1);i.x*=3.;d=d.x<i.x?d:i;m.xz*=s(sin(m.y*.3)*.3+y);i=vec2(length(sin(m-vec3(0,y*5.,0))),6);i.x=max(i.x,length(m.xz)-5.);n+=.1/(.1+i.x*i.x*50.);d=d.x<i.x?d:i;if(x>5){if(x>7)i=vec2(length(m.xz)-17.,6.),i.x=max(abs(i.x)-1.,abs(abs(m.y)-18.)-2.),d=d.x<i.x?d:i,i=vec2(length(m.xz)-17.,3.),i.x=max(abs(i.x)-1.2,abs(abs(m.y)-18.)-1.),d=d.x<i.x?d:i,m.yz*=s(1.57),i=s(abs(m)-vec3(0,0,7),0.,1),d=d.x<i.x?d:i;else i=vec2(.8*v,6),d=d.x<i.x?d:i;}return d;}const float r[]=float[18](-.5,2.,2.5,1.05,2.,1.5,0.,0.,4.,0.,9.,-3.,5.,15.,6.,20.,10.,7.);void mainImage( out vec4 fragColor, in vec2 fragCoord){y=mod( iTime,60.),x=int(floor( iTime/15.));w=vec3(0.);vec2 l,g=vec2(0),b=vec2(.1),o=(fragCoord.xy/iResolution.xy-.5)/vec2(iResolution.x/iResolution.y,1),h=vec2(.00035,-.00035);i=sin(y*2.*a/.4688),z=sin(y*2.*a/.4688+.9376);if(x>4)z= iTime<127.5?sin(y*2.*a/.9376)*1.5:0.;if( iTime<15.|| iTime>56.25&& iTime<60.|| iTime>75.)i=0.;d=vec4(r[x],4.,mix(25.,r[x+12],s(0.,15.)),.2);f=vec4(2.+s(0.,5.)*2.+i*.1,-.2+1.4*s(5.,10.)+z*.05*step(30., iTime),3.,.1*s(15.,1.));c=vec4(step(30., iTime)*(mod(y,15.)*.5+3.14*smoothstep(0.,1.,min(mod(y,15.),1.))),s(15.,15.),.5,80);e=vec4(0,0,1,.0001);v=-1.+2.*ceil(sin(y*a/7.5));m=v*vec3(cos(y*d.w+d.x)*d.z+r[x+6],d.y,sin(y*d.w+d.x)*d.z);if(x>3)f.xyz+=vec3(1.,.2,1.);if(x>5){m=vec3(cos(y*.5)*5.,10.+sin(y*.5)*5.,-11.);c.xzw=vec3(0.,0.,1.);e.xyz=vec3(1.,1.,1.-2.*step(105., iTime));if( iTime<105.|| iTime>120.)m.x*=v;w.x=1.;}if(x>7)f.xyz+=vec3(.5,.1,0.),e.yzw=vec3(1,-1,4e-05),m.z=10.,m.y=3.,m.x*=-v,w.xz=vec2(step( iTime,127.5),1.);vec3 u=normalize(vec3(0)-m),k=normalize(cross(u,normalize(vec3(c.z,1,0)))),F=normalize(cross(k,u)),C=mat3(k,F,u)*normalize(vec3(o,.5)),Z=normalize(m),Y,X,W,V,U;Y=X=vec3(.1)-length(o)*.1-C.y*.1;for(int T=0;T<128;T++){l=p(m+C*b.x);if(l.x<.0001||b.x>80.)break;b.x+=l.x;b.y=l.y;}if(b.x>80.)b.y=0.;k=.2*vec3(.95,.4,.05);F=.2*vec3(.05,.15,.6);u=n.x*F+n.y*k;g[int(step( iTime,120.))]=1.;if(b.y>0.)W=m+C*b.x,V=normalize(h.xyy*p(W+h.xyy).x+h.yyx*p(W+h.yyx).x+h.yxy*p(W+h.yxy).x+h.xxx*p(W+h.xxx).x),U=b.y==5.?vec3(.1,.2,.4):vec3(b.y<5.?0.:1.),Y=mix(pow(max(dot(reflect(-Z,V),-C),0.),40.)+mix(vec3(.8),vec3(1),abs(C))*U*(clamp(p(W+V*.1).x/.1,0.,1.)*clamp(p(W+V*.3).x/.3,0.,1.)+.2)*(max(0.,dot(V,Z))+smoothstep(0.,1.,p(W+Z).x)),X,min(pow(1.+dot(V,C),4.),.2)),Y=mix(X,Y+u*g.x,exp(-e.w*b.x*b.x*b.x));fragColor=vec4(mix(vec3(0),pow(Y+u*g.y+n.z*k*w.z,vec3(.65)),s(0.,3.)-s(137.,3.)),-.5+clamp(b.x*.1+.5,0.,.9));}