Page 2 of 3

Re: [Competition] AHK dwitter!

Posted: 04 Jan 2018, 12:42
by tidbit
need more gifs guys.

Re: [Competition] AHK dwitter!

Posted: 07 Jan 2018, 16:38
by waetherman
Cogs

Code: Select all

u(j=0,@=1){
	f()
	while 3>j,i=.5,@*=-1,x=j++*w/2
		while 97>i,ᴀ=ɢ,ʀ=ᴇ,ɢ=x+s(p:=pi/48*i+t*@)*q:=(i&2?.26:.24)*w,ᴇ=h/2+c(p)*q
			i++>1?dl(ɢ,ᴇ,ᴀ,ʀ)
}
Character count: 139 (146 with indenting)

Result:
Image

Re: [Competition] AHK dwitter!

Posted: 08 Jan 2018, 07:26
by waetherman
Flappy Photon game
Your name is Foton Partikel. Hold W to go up, do nothing to fall. Remain in the wave function or be collapsed.

Code: Select all

u(i=0) {
	f()
	while 9>i
		dl(x:=i/9*w,y:=h/5+c(i+t+9)*h/3,x,b:=h/2+y)i++==0&&pi>y&&pi<b?k:=1
	k?fc(6,pi+=GetKeyState("w")?-t/99:.1,9):pi:=t:=0
}
Character count: 140 (145 with indenting)

Result:
Image

Re: [Competition] AHK dwitter!

Posted: 09 Jan 2018, 06:37
by RUNIE
Wibbly wobbly infinite moving stroby hallway

Code: Select all

u(s=0){
	while 63>++s
		a:=w*(s-1)/128,fr(a+s(t*-2+s/7)*32,a+s-128+a/3,w-a*2,w-a*2+128,r(255,255,255,(s(t*-2+s/24)+1.1)/2.2))
}
Character count: 127

You'll have to run it to see, it really doesn't capture well on gifs :D

Re: [Competition] AHK dwitter!

Posted: 09 Jan 2018, 08:46
by rommmcek
Awesome... 3D... The best!

P.s.: I think gif is good enough for preview.

Re: [Competition] AHK dwitter!

Posted: 09 Jan 2018, 09:17
by RUNIE
My attempt at capturing it as a gif didn't go too well... maybe the software (LICEcap) I'm using is trying to compress it too much.

Re: [Competition] AHK dwitter!

Posted: 12 Jan 2018, 12:32
by waetherman
Bacteria

Code: Select all

u() {
	static x=0,y=9,a=1
	q:=x+s(a)*99,e=y+c(a)*99
	q>w||e>h||q<0||e<0?a-=1.5:x:=q+0*y:=e
	fc(q//8*8,e//8*8,2,r(w,,w,s(t*99)))
}
Character count: 125 (129 with indenting)

Have fun playing with the width and height, as well as with the code.
Spoiler

Re: [Competition] AHK dwitter!

Posted: 12 Jan 2018, 15:08
by waetherman
Digiballs
My digital balls are amazing

Code: Select all

u(r=2,i=99) {
	while i-->0,c=t-r*d/2,p=Mod(c/6+a(t(i)),1.5)
		fc(a(s(p))*w//9*9-r,h-a(c(c+i/9))*h*c(p)**2//9*9-r-9,2+r,h(i/9,1-r*.4))
	r?u(0)
}
Character count: 139 (143 with indenting)

Feel free to play with my balls ( ͡° ͜ʖ ͡°)
decrease i for less balls, set r to 1 or 0 for a different effect

Re: [Competition] AHK dwitter!

Posted: 12 Jan 2018, 19:02
by tidbit
waetherman: how are you a master at math? I vote you as winner, winner*8.
those balls are amazing.

making random changes, so much fun combos. this simple one makes them start in different spots going both directions:

Code: Select all

u(r=2,i=80) {
	while i-->0,c=t-r*d/2,p=Mod(c/6+a(t(i)),1.5)
		fc(a(s(p+i))*w//9*9-r,h-a(c(c+i/9))*h*c(p)**2//9*9-r-9,2+r,h(i/9,1-r*.4))
	r?u(0)
}
also, holy crap? collision detection?
and the fact it stays on a 'grid' is lovely

Re: [Competition] AHK dwitter!

Posted: 13 Jan 2018, 04:44
by waetherman
tidbit wrote:waetherman: how are you a master at math?
I’m not, I’m just a very fast typer and abuse infinite monkey theorem.

Re: [Competition] AHK dwitter!

Posted: 14 Jan 2018, 17:22
by waetherman
Drunk Painter
Painter go home…

Code: Select all

u(){
static x=0,y=0
fc(x-r:=9+s(t-d)*7,y-r,r,h(t-d,.5))
MouseGetPos a,b
b-=c(t)*9,x=x*.999+a/999,y=y*.998+b/w
fc(x-r:=9+s(t)*7,y-r,r,h(t))
}
Character count: 140

Result:
Image

Re: [Competition] AHK dwitter!

Posted: 14 Jan 2018, 19:43
by RUNIE
Aaaaand the winner is...

Cogs by waetherman!

Image

We'll talk on Discord ;)

Re: [Competition] AHK dwitter!

Posted: 14 Jan 2018, 21:17
by tidbit
"wheel talk on Discord"

ftfy

Re: [Competition] AHK dwitter!

Posted: 15 Jan 2018, 04:08
by wolf_II

Code: Select all

u(){
z:=pi*(3-Sqrt(5)),i:=0,r:=Sqrt(w/2*w/2+h/2*h/2)+5,l:=4,k:=l-1,t:=(r*r)/(l*l)
Loop,%t%
i++,r:=l*sqrt(i),a:=i*z,x:=r*c(a),y:=r*s(a),fc(w/2+x,h/2+y,k,h(a))
}
yes, I know: competition is over. 160 chars.
phyllotaxis.png
phyllotaxis.png (212.87 KiB) Viewed 4729 times

Re: [Competition] AHK dwitter!

Posted: 15 Jan 2018, 04:22
by jeeswg
- The competition is never over. Btw I would love to see spinning letters/numbers if that's possible. I will take a look myself eventually, possibly in some weeks/months.
- Btw ideas:
Fun with GDIPlus (GDI+) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=6071
The hardest problem on the hardest test - YouTube
https://www.youtube.com/watch?v=OkmNXy7er84
[GDI+][Class] Particle System 2.0 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26485
- @GeekDude: What happened to the script for this?
Fun with GDIPlus (GDI+) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 691#p52691
- @tidbit: What happened to the script for this? Or some other flame-based image I think it was.
Particle-System/Gif (4).gif at master · acorns/Particle-System · GitHub
https://github.com/acorns/Particle-Syst ... %20(4).gif

Re: [Competition] AHK dwitter!

Posted: 15 Jan 2018, 13:12
by tidbit
those presets were not bundled with. only for testing / showing off. those used a much older simpler version aswell, pre-gui. people were impressed so I added a lot more. started to get too confusing and useless so i stopped.

Re: [Competition] AHK dwitter!

Posted: 15 Jan 2018, 13:29
by waetherman
I was surprised when I’ve read that I won, as I was sure Geekdude would win, because he had quite clever scripts, some were also very aesthetically pleasing: drawing was neat, cube was great, Mandelbrot was of course amazing as always; I was mostly impressed by the hacky method of kissing up, and in general space efficient storage for similar stuff like the Twitter logo.

I’d like to thank Runie and all participants, as thanks to you I dived into something I always avoided from far: the codegolfing — perhaps because typically it’s about boring, job–interview–like tasks, and here we were free to create anything we want in given constraints. I’ve learned quite a few tricks during this event, some of which maybe I will even be able to use in real projects.

I thought as a winner I should end the competition with one final piece, so here it goes:
Unpredictabline

Code: Select all

u() {
static x=0,y=9,a=1
q:=x+s(a),e=y+c(a)
q>w||e>h||q<0||e<0?a-=Mod(t,2)+1:x:=q+0*y:=e
fc(q//2*2,e//9*9,4,h(t,s(t)*.5+.5))
}
Character count: 126

Result:
Image[/quote]
wolf_II wrote:

Code: Select all

u(){
z:=pi*(3-Sqrt(5)),i:=0,r:=Sqrt(w/2*w/2+h/2*h/2)+5,l:=4,k:=l-1,t:=(r*r)/(l*l)
Loop,%t%
i++,r:=l*sqrt(i),a:=i*z,x:=r*c(a),y:=r*s(a),fc(w/2+x,h/2+y,k,h(a))
}
yes, I know: competition is over. 160 chars.
How about the code below?

Code: Select all

u(i=0){
Loop,12800
fc(w/2+c(a:=++i*2.3999632297)*r:=4*i**.5,h/2+r*s(a),3,h(a))
}
I really like that effect, at first I was confused on how you draw diamonds (squares rotated by 45 degrees), it must be the arrangement of the circles that make such illusion.

Re: [Competition] AHK dwitter!

Posted: 16 Jan 2018, 02:56
by Xeo786
Simple UFO invading ground, use arrow keys to move and and space to attack,

Code: Select all

global Vy := 50
global Vx := 50
u() {
	f()
	Vy := GetKeyState("Up") ? Vy-1 : GetKeyState("Down") ? Vy+1 : Vy
	Vx := GetKeyState("Left") ? Vx-1 : GetKeyState("Right") ? Vx+1 : Vx
	fe(Vx,Vy,58,30,h(2/20))
	fc(Vx+25,Vy-10,4,h(6/3))
	loop, 4
		fc(Vx+(10*a_index),Vy+10,4,h(2/3))
	if GetKeyState("space")
		loop, 20
 			fc(Vx+25,Vy+30+(a_index*40),4,h(a_index/6))
}
But I can't create Game like space invaders coz there is lotz to learn :headwall:

Re: [Competition] AHK dwitter!

Posted: 16 Jan 2018, 13:11
by waetherman
Xeo786 wrote:But I can't create Game like space invaders

Code: Select all

u() {
	static p=320,v=0,px=0,py=0,sx=0,sy=0,row,number,numbers,aliens,alien=[[[0,0,1,0,0,0,0,0,1,0,0],[0,0,0,1,0,0,0,1,0,0,0],[0,0,1,1,1,1,1,1,1,0,0],[0,1,1,0,1,1,1,0,1,1,0],[1,1,1,1,1,1,1,1,1,1,1],[1,0,1,1,1,1,1,1,1,0,1],[1,0,1,0,0,0,0,0,1,0,1],[0,0,0,1,1,0,1,1,0,0,0]],[[0,0,0,0,1,0,1,0,0,0,0],[1,0,0,1,0,0,0,1,0,0,1],[1,0,1,1,1,1,1,1,1,0,1],[1,1,1,0,1,1,1,0,1,1,1],[0,1,1,1,1,1,1,1,1,1,0],[0,0,1,1,1,1,1,1,1,0,0],[0,0,1,0,0,0,0,0,1,0,0],[0,0,0,1,1,0,1,1,0,0,0]]]
	static reset=0
	if (reset) {
		reset := 0
		d := 0
	}
	d?:d:=0
	--row?:row:=5
	
	if(!aliens) {
		f()
		t:=0
		number:=55
		numbers:=[11,11,11,11,11]
		y:=0,aliens=[]
		while y++<5,x=0,aliens.push(r:=[])
			while x++<11
				r.push(1)
	}
	d+=d*(55-number)/20
	t+=d 
	offsetX := ((t*9)&63)*3 -30
	offsetY := (t*9)//64
	if (offsetY>19-numbers.length()) {
		MsgBox game over
		reset := 1 ;temp
		return aliens:=0
	}
	offsetY&1?offsetX:=129-offsetX
	offsetY*=30
	
	
	y:=(offsetY+row*30)//3|0
	fr(0,y*3-$:=(row>1?0:30),640,30+$,0)
	dl(px,py,px,py+20,0)
	px:=sx,py:=sy
	
	dl(sx,0,sx,offsetY,0)
	if(!sy) {
		GetKeyState("space")?sy:=580+0*sx:=p+10
	} else {
		a:=(sy-offsetY)//30|0
		b:=(sx-offsetX)//39|0
		if (aliens[a][b]) {
			aliens[a][b]:=0
			number--
			numbers[a]--
			loop 5
				numbers[numbers.Length()]?:numbers.pop()
			if(!numbers.Length()) {
				MsgBox You won!
				return aliens := 0
			}
			sy:=0
		} else {
			dl(sx,sy,sx,sy+20)
			sy:=Max(0,sy-d*400)
		}
	}
	
	c := 0
	r:=row
	while c++<11,y=0
		if(aliens[r][c])
			while y++<8,x=0
				while x++<11
					alien[(t&1)+1][y][x]?fr(offsetX+c*39+x*3, offsetY+r*30+y*3, 2, 2)
	l:=GetKeyState("left"),r=GetKeyState("right"),v=(v>0&&l)||(v<0&&r)||!(l+r)?0:v+9*d*(r-l)
	p:=Max(0,Min(620,p+v)),fr(0,596,640,30,0)fr(p,600,20,5)fc(p+7,596,3)
}

Re: [Competition] AHK dwitter!

Posted: 16 Jan 2018, 16:42
by derz00
Only get close to winning by holding the space bar. Speed of left and right increase with time, as well as bullet frequency. lol


This artwork floors me. simply unbelievable unless I had seen it myself.