Search results for 'War game/net-force.nl'

Programming - 2. Are you fast enough?

2008. 6. 13. 02:19
Question:

This challenge is a simple calculation.
When you click on the link below you will get a number.
The calculation is: answer = (number * 3 + 2) - 250

Example with number 1500:
4252 = (1500 * 3 + 2) - 250

In this example 4252 is the answer...answer like this: prog2.php?solution=4252
You must do this within 2 seconds. If the answer is correct, you will get the password.


answer: 
             처음엔 걍 c로 만들어서 2초안에 넣어볼라고 쇼를 했다.
             내타수가 그렇게 느린줄 몰랐다. 세상에 만만한거 하나 없더라.
             뭘로 해볼까 하다가 만만한 자바 스크립트로 했는데 막상 해볼려니
             이것 또한 시간을 꽤나 잡아먹었다.

<html>
<head>
<script>
function calc(){
str1 = myform.solution.value;
answer = (str1 * 3 + 2) - 250;
myform.solution.value = answer;
return;
}
</script>
</head>
<body>
<form name="myform" method="get" action="http://net-force.nl/challenge/level602/prog2.php" onsubmit="calc()">
Number: <input type=text name=solution><br>
<input type=submit value=전송>
</form>
</body>
</html>

       
The password is: damnfast

'War game > net-force.nl' 카테고리의 다른 글

Programming - 1. keep walking...  (0) 2008.06.12

badcob War game/net-force.nl

Programming - 1. keep walking...

2008. 6. 12. 16:52

Question :

This is a challenge to test your basic programming skills.

Pseudo code:
Set X = 1
Set Y = 1
Set previous answer = 1

answer = X * Y + previous answer + 3

After that => X + 1 and Y + 1 ('answer' becomes 'previous answer') and repeat this till you have X = 525.

The final answer is the value of 'answer' when X = 525. Fill it in below to check if it's the correct answer. If it is, you will get the password for the challenge page.


answer :

#include <stdio.h>

void main(void)
{
 int x=1, y=1;
 int answer = 1;
 
 for(;x<526;)
 {
 answer = (x++) * (y++) + answer + 3;
  if(x==524)
  printf("\nprevious answer = %d", answer);
 }
 printf("\nx=%d, y=%d\nanswer = %d",x,y,answer);
 return;
 }

enter : 48373851

Nice one, the password is: pr0ggen

'War game > net-force.nl' 카테고리의 다른 글

Programming - 2. Are you fast enough?  (0) 2008.06.13

badcob War game/net-force.nl