Codeio
Codeio
C............................................................................................................................ 2
Morse Code............................................................................................................ 3
Brainf**k................................................................................................................ 3
Prolog..................................................................................................................... 3
C++....................................................................................................................... 4
PHP........................................................................................................................ 5
C#......................................................................................................................... 5
Linux Shell Scripting.............................................................................................. 5
ROT13.................................................................................................................... 5
The rules:
1.Participants would be given certain number of codes written in several different
programming languages/cipher codes.
2.Given maximum 1 hour to trace the output of the given codes , participant who
submit later than 1 hour would be disqualified.
3.Participant who gets the most number of correct outputs would win.
4.Participants need to submit the solution to the time keeper then the time
keeper would record the duration for each participants submission.
5.If there is a draw (the number of correct outputs is same), participants who
submit faster would be chosen.
6.Given ASCII value for 0 is 48, A is 65 and a is 97.
C
#1
#2
#include<stdio.h>
int main()
{
int n=5,i,c,a=1;
for(i=1;i<=n;i++)
{
for(c=1;c<=i;c++)
{
printf("%d",a);
a++;
}
printf("\n");
}
return 0;
}
#include<stdio.h>
int main()
{
int n=1<<4;
printf("The answer is:%d",n);
return 0;
}
#3
#include<stdio.h>
int main()
{
for(int i=3;i<5;i++)
printf("Soar");
return 0;
}
#4
#include<stdio.h>
int main()
{
for(int i=10;i>0;i/=2)
printf("%d\n",i);
return 0;
}
Java
#5
class HelloWorld{
public static void main(String []args){
System.out.println("Deez");
System.out.println("Hello");
}
}
#6
import java.util.*;
import java.lang.*;
class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
int n=5,a=0,b=1,c=0,i=0;
while(i<n)
{
System.out.print(c + "\t");
a=b;
b=c;
c=a+b;
i++;
}
}
}
Morse Code
#7
-.-.
.-
.-.
.-.
..-.
.-
..
.-.
.----
-....
Brainf**k
HINT+ : Increments the value at the current cell by one.
- : Decrements the value at the current cell by one.
> : Moves the data pointer to the next cell (cell on the right).
< : Moves the data pointer to the previous cell (cell on the left).
. : Prints the ASCII value at the current cell
, : Reads a single input character into the current cell.
[ : If the value at the current cell is zero, skips to the corresponding ] .
Otherwise, move to the next instruction.
] : If the value at the current cell is zero, move to the next instruction.
Otherwise, move backwards in the instructions to the corresponding [ .
[ and ] form a while loop. Obviously, they must be balanced.
#8
+++++
+++++
+++++
+++++
+++++
+++++
+++++
+++++
+++++
+++++
+++++
+++++
#9
+++++ +++++[>+++++ ++++>+
++++ +++<<-]
>--><.>.<.
<
+++++ +++++[>-----<-]>----...
+++++ ++++
.....
Prolog
#10
print_tree(nil).
print_tree(bt(L,Val,R)):write(Val),
print_tree(L),
print_tree(R).
Listen: ?-print_tree(bt(bt(nil,1,nil),7,bt(nil,9,nil))).
C++
#11
#include<iostream>
using namespace std;
class A{
public:
int num[3];
A()
{
for(int i=0,j=3;i<3;i++)
{
num[i]=j--;
}
}
};
int main()
{
A bomb;
bomb.num['A'-65]=99;
for(int i=0;i<3;i++)
{
cout<<bomb.num[i]<<" ";
}
return 0;
}
#12
#include<bits/stdc++.h>
using namespace std;
int main(){int a=3;while(a--)cout<<"The clock is ticking!"<<endl;}
#13
#include<iostream>
using namespace std;
int main()
{
int a[3]={71,87,80};
for(int i=0;i<3;i++)
{
if(i==0)
cout<<static_cast<char>(a[i]);
cout<<static_cast<char>(a[i]);
}
return 0;
}
PHP
#14
<?php
for($i=1;$i<=5;$i++)
{
for($j=5;$j>=$i;$j--)
{
echo "*";
}
echo "<br>";
}
?>
C#
#15
using System;
namespace Rextester
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Soaring");
Console.WriteLine("Upwards");
if(false)Console.WriteLine("**");
else Console.WriteLine("!!");
}
}
}
Barry
ROT13
#18
fnln fnlnat njnx