Showing posts with label Challenge. Show all posts
Showing posts with label Challenge. Show all posts

Sunday, December 6, 2009

JS Challenge #1

Self Evaluating JS
Here is an example:
<div id=toexec>
"Hello World<!--".replace("Hello World",'"Goodbye World"');//-->"
</div>
<button onclick=exec()>Exec</button>
<script>

function exec(){
var n = document.getElementById('toexec');
n.innerHTML = eval(n.innerHTML);
}
</script>

The Challenge
Actually there isn't one. I just really like that code

http://qaa.ath.cx/pexec.html

CSS Challenge #3

No diagram for this.

The challenge is to define some CSS so that you can do basic math operations. I have a nice working example hidden away.

The specs are

class="number operator number"

where number is one of [one, two, three, four, five, six, seven, eight, nine]

and operator is either [plus, minus]

So that if you do
<div class='three plus eight' />

you'll see say, 11 squares or some other kind of unit.

Extra points if you can make negatives work too.

You ought to be able to do it in 12 definitions or less...

good luck!

CSS Challenge #2

Same HTML as #1, but the CSS must be within this:

div { /* You probably need at least this */ }
body{ /* and you can use this too */ }

CSS Challenge #1

So I give you the HTML, you give me the CSS:


<div style=border-color:lime />
<div style=border-color:yellow />
<div style=border-color:red />

Programming Challenge #2

If you can solve 1, you can solve 2

#include<stdio.h>
main(){
char ByModifyingThis[]="What happened?";
char printThis[]="You won!";

// your space

printf("%s",ByModifyingThis);
}

Programming Challenge #1

Ok, first to post a correct 1 line solution wins...

#include<stdio.h>
void gettohere()
{
printf("You win!");
}

int main(void)
{
// From Here
// Without calling gettohere();

return 0;
}

Followers