Skip to content

Instantly share code, notes, and snippets.

View christmoore's full-sized avatar

Christopher Moore christmoore

View GitHub Profile
int hero_pos = 0;
int one = rand()% 9 + 1;
int two = rand() % 9 + 1;
int three = rand() % 9 + 1;
while (one == two || one == three || two == three)
{
one = rand()% 9 + 1;
two = rand() % 9 + 1;
three = rand() % 9 + 1;
int i = 1;
do
{
System.out.println(i);
i+=2;
} while (i <= 1001);
int i = 1;
while (int i <= 1001)
{
System.out.println(i);
i+=2;
}
int i = 1;
while (int i <= 1001)
{
}
for (int i = 1; i <= 1001; i += 2)
{
System.out.println(i);
}
int x = 2**2;
if(x > 4)
{
System.out.println("Does this work?");
}
else if(x % 2 == 1)
{
System.out.println("Does this work?");
}
else
int x = 2**2;
if(x > 4)
{
System.out.println("Does this work?");
}
else if(x % 2 == 0)
{
System.out.println("Does this work?");
}
int x = 2**2;
if(x > 4)
{
System.out.println("Does this work?");
}
int i = 9;
if(i % 2 == 1)
{
System.out.println("Does this work?");
}
int i = 1;
if (i < 2)
{
System.out.println("This is an if statement that works");
}
int i = 4;
if (i < 2)
{
System.out.println("This is an if statement that doesn't works");
}
public class HelloWorld
{
public void HelloWorld()
{
System.out.println("Hello World");
}
public static void main(String[] args)
{
HelloWorld hw = new HelloWorld();
}