Context Free Fight

If you have a design you're proud of, share the cfdg file here. It's also a good place to ask for feedback and collaborate.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
momo
Posts: 53
Joined: Tue Jul 19, 2005 5:08 am

Context Free Fight

Post by momo »

I've been thinking about a new way of sharing and learning context free code.

It's a game where players modify other's people code, we best see an example:

player 1 starts the game with this code:


Code: Select all

startshape START

rule START {
	CIRCLE { }
}
Then player 2 continues editing this code and adding new things:

Code: Select all

startshape START

rule START {
	CIRCLE { }
	CIRCLE { s 0.9 b 1 }
	START { s 0.8 }
}
Then a new player edits again the code:

Code: Select all

startshape START

rule START {
	F_CIRCLES { }
	START { y 1 r 5 s 0.9 }
}

rule F_CIRCLES {
	CIRCLE { }
	CIRCLE { s 0.9 b 1 }
	F_CIRCLES { s 0.8 }
}
Then player 4 adds color to it, etc...

Just a game, there's no winer but i think it could be fun and we can learn a lot about context free. What do you think about it?

User avatar
fbo
Posts: 8
Joined: Sat Aug 13, 2005 2:54 am

Post by fbo »

so:

Code: Select all

startshape START

rule START {
   F_CIRCLES { }
   F_TRIANGLES {}
   START { y 1 r 5 s 0.9 }
}

rule F_CIRCLES {
   CIRCLE { }
   CIRCLE { s 0.9 b 1 }
   F_CIRCLES { s 0.8 }
}

rule F_TRIANGLES {
  TRIANGLE {}
  TRIANGLE {s 0.9 b 1 }
  F_TRIANGLES { s 0.8 }
}

User avatar
aaronstj
Posts: 66
Joined: Wed Jul 06, 2005 11:34 am
Location: Seattle

Post by aaronstj »

Me next, me next!

Code: Select all

startshape START

rule START {
	SPIRAL{}
	SPIRAL { r 120 }
	SPIRAL { r 240 }
}

rule SPIRAL {
   F_CIRCLES { }
   F_TRIANGLES {}
   SPIRAL { y 1 r 5 s 0.9 }
}

rule SPIRAL .05 {
	START {}
}

rule F_CIRCLES {
   CIRCLE { }
   CIRCLE { s 0.9 b 1 }
   F_CIRCLES { s 0.5 }
}

rule F_TRIANGLES {
  TRIANGLE {}
  TRIANGLE {s 0.9 b 1 }
  F_TRIANGLES { s 0.5 }
} 
Time for someone to add color, methinks.

Bargonaut
Posts: 21
Joined: Wed Jul 27, 2005 1:28 pm

Color it is...

Post by Bargonaut »

Code: Select all

startshape START

rule START {
   SPIRAL{}
   SPIRAL { r 120 }
   SPIRAL { r 240 }
}

rule SPIRAL {
   F_CIRCLES { }
   F_TRIANGLES {}
   SPIRAL { y 1 r 5 s 0.9 }
}

rule SPIRAL .05 {
   START {}
}

rule F_CIRCLES {
   CIRCLE {  hue 220 sat 0.9 b 0.33  }
   CIRCLE { s 0.9 hue 220 sat 0.25 b 1 }
   F_CIRCLES { s 0.5 }
}

rule F_TRIANGLES {
  TRIANGLE {  hue 0 sat 0.9 b 0.33  }
  TRIANGLE { s 0.9 hue 0 sat 0.5 b 1 }
  F_TRIANGLES { s 0.5 }
}
Image

momo
Posts: 53
Joined: Tue Jul 19, 2005 5:08 am

Post by momo »

I moved the triangles out of the circles, and replaced the circles with squares.

Then i added a rotation in the F_TRIANGLES and F_SQUARES rules.

who's the next one? :wink:

Image

Code: Select all

startshape START

rule START {
   SPIRAL{}
   SPIRAL { r 120 }
   SPIRAL { r 240 }
}

rule SPIRAL {
   F_SQUARES { }
   F_TRIANGLES { x 0.5 y 0.5 r 45 }
   SPIRAL { y 1 r 25 s 0.9 }
}

rule SPIRAL 0.022 {
	START { flip 90 hue 50}
}

rule F_SQUARES {
   SQUARE {  hue 220 sat 0.9 b 0.33  }
   SQUARE { s 0.9 hue 220 sat 0.25 b 1 }
   F_SQUARES { s 0.8 r 5}
}

rule F_TRIANGLES {
  TRIANGLE {  hue 10 sat 0.9 b 0.33  }
  TRIANGLE { s 0.9 hue 10 sat 0.5 b 1 }
  F_TRIANGLES { s 0.8 r 5 }
} 

Bargonaut
Posts: 21
Joined: Wed Jul 27, 2005 1:28 pm

I'll take another turn

Post by Bargonaut »

I thought it could use a little alpha blending.
So, how do we know when it's done?

Image

Code: Select all

startshape START

background {
hue 66 sat 0.4 b 0.5
}

rule START {
SPIRAL{}
SPIRAL { r 120 }
SPIRAL { r 240 }
}

rule SPIRAL {
F_SQUARES { }
F_TRIANGLES { x 0.5 y 0.5 r 45 }
SPIRAL { y 1 r 25 s 0.9 }
}

rule SPIRAL 0.022 {
START { flip 90 hue 50}
}

rule F_SQUARES {
SQUARE { x 0.1 y 0.1
alpha -0.33 hue 250 sat 0.7 b 0.8 }
SQUARE { hue 220 sat 0.9 b 0.33 }
SQUARE { s 0.9 hue 220 sat 0.25 b 1 }
F_SQUARES { s 0.8 r 5 }
}

rule F_TRIANGLES {
TRIANGLE { x 0.1 y 0.1
alpha -0.33 hue 20 sat 0.7 b 0.8 }
TRIANGLE { hue 10 sat 0.9 b 0.33 }
TRIANGLE { s 0.9 hue 10 sat 0.5 b 1 }
F_TRIANGLES { s 0.8 r 5 }
} 

momo
Posts: 53
Joined: Tue Jul 19, 2005 5:08 am

Re: I'll take another turn

Post by momo »

Bargonaut wrote:I thought it could use a little alpha blending.
So, how do we know when it's done?
well, we don't know when it's done. I think it will be done when nobody else wants to continue editing it, or we feel it's good enought

Anyway, i think i'm going to look into this one a little more.

In the future, if we want to play it again, it should be a good idea to set a limit or just allow one edit for user if there are a lot.

momo
Posts: 53
Joined: Tue Jul 19, 2005 5:08 am

Post by momo »

Some rotations:

Image

Code: Select all

startshape START

background {
hue 66 sat 0.4 b 0.5
}

rule START {
SPIRAL{}
SPIRAL { r 120 }
SPIRAL { r 240 }
}

rule SPIRAL {
F_SQUARES { }
F_TRIANGLES { x 0.5 y 0.5 r 45 }
SPIRAL { y 1 r 47 s 0.9 }
}

rule F_SQUARES {
SQUARE { x 0.1 y 0.1 alpha -0.33 hue 250 sat 0.7 b 0.8 }
SQUARE { hue 220 sat 0.9 b 0.33 }
SQUARE { s 0.99 0.2  b 1 sat 0.9 }
F_SQUARES { s 0.2  r 10 hue 30}
}

rule F_TRIANGLES {
TRIANGLE { x 0.1 y 0.1
alpha -0.33 hue 20 sat 0.7 b 0.8 }
TRIANGLE { s 2 0.5 hue 10 sat 0.9 b 0.33 }
TRIANGLE { s 1.9 0.4  sat 0.8 b 1 }
F_TRIANGLES { s 0.8 0.9 r 45 hue 5}
} 
Last edited by momo on Sun Oct 02, 2005 2:04 am, edited 1 time in total.

Bargonaut
Posts: 21
Joined: Wed Jul 27, 2005 1:28 pm

Post by Bargonaut »

OK, then this will be my last turn. It's just so hard to resist another tweak...

Just a little tighter scaling, introduces some internal spirals.
Image

Code: Select all

startshape START

background {
hue 66 sat 0.4 b 0.5
}

rule START {
SPIRAL{}
SPIRAL { r 120 }
SPIRAL { r 240 }
}

rule SPIRAL {
F_SQUARES { }
F_TRIANGLES { x 0.5 y 0.5 r 45 }
SPIRAL { y 1 r 47 s 0.975 }    // scale a bit tighter
}

rule F_SQUARES {
SQUARE { x 0.1 y 0.1 alpha -0.33 hue 250 sat 0.7 b 0.8 }
SQUARE { hue 220 sat 0.9 b 0.33 }
SQUARE { s 0.99 0.2  b 1 sat 0.9 }
F_SQUARES { s 0.2  r 10 hue 30}
}

rule F_TRIANGLES {
TRIANGLE { x 0.1 y 0.1
alpha -0.33 hue 20 sat 0.7 b 0.8 }
TRIANGLE { s 2 0.5 hue 10 sat 0.9 b 0.33 }
TRIANGLE { s 1.9 0.4  sat 0.8 b 1 }
F_TRIANGLES { s 0.8 0.9 r 45 hue 5}
}


Bargonaut
Posts: 21
Joined: Wed Jul 27, 2005 1:28 pm

How about...

Post by Bargonaut »

To make it more of a competitive "fight", we could end the game with a poll for the best variation. The winner will have the result posted to close the thread.

momo
Posts: 53
Joined: Tue Jul 19, 2005 5:08 am

Post by momo »

yeah, i like the idea, but i think we could start with more complex files, it's more interesting than starting with a simple cirlce.

User avatar
UglyPuppy
Posts: 12
Joined: Thu Jul 07, 2005 2:33 pm
Location: here
Contact:

Post by UglyPuppy »

here's my rendition...

Image
startshape START

background {
hue 235 sat 0.05 b .1
}

rule START {
SPIRAL{}
SPIRAL {y -1.5 x 1.4 r 90 s 1.2 .84}
SPIRAL { r 240}
START {y 7 x -7.5 r 90 s .6 hue -5}
START {y 7 x 7.5 r -90 s .6 hue -5}
}

rule SPIRAL {
F_SQUARES { }
F_TRIANGLES { x 0.5 y 0.5 r 45 }
SPIRAL { y 3 r 47 s 0.975 } // scale a bit tighter
}

rule F_SQUARES {
KNARLF { x 0.1 y 0.1 s .5 alpha -0.63 hue 250 sat 0.7 b 0.4 }
SQUARE { hue 220 sat 0.9 b 0.43 }
KNARLF { s 0.99 0.2 alpha -0.75 b 1 sat 0.9 hue 160 b .5}
F_SQUARES { s 0.2 r 10 hue 30}
}

rule F_TRIANGLES {
TRIANGLE { x 0.1 y 0.1
alpha -0.33 hue 20 sat 0.7 b 0.8 s 1.5}
TRIANGLE { s 2 0.5 hue 10 sat 0.9 b 0.33}
TRIANGLE { s 1.9 0.4 sat 0.8 b 1 s 1.5 }
F_TRIANGLES { s 0.8 0.9 r 45 hue 5}
}

rule KNARL {
SQUARE {}
KNARL {x 1 r 17.5 s .95}
}

rule KNARL {
SQUARE {}
KNARL {x 1 r -17.5 s .94}
}

rule KNARLF {
KNARL {}
KNARL {flip 90}
}

momo
Posts: 53
Joined: Tue Jul 19, 2005 5:08 am

Post by momo »

crazy, i like the blue curves in the background.

Post Reply