Paste what you have copied :D

Status
Not open for further replies.

ethical1337

Don't choose the easy path just because its easy
Joined
Aug 6, 2011
Messages
415
Reaction score
516
DO
foundletter = FALSE
DO
a$ = INKEY$
LOOP UNTIL a$ <> ""
a$ = UCASE$(a$)

SELECT CASE a$
CASE "A" TO "Z"
IF letter(ASC(a$) - 64) = 0 THEN
FOR x = 1 TO LEN(wordtoguess)

IF UCASE$(MID$(wordtoguess, x, 1)) = a$ THEN
PRINT MID$(wordtoguess, x, 1)
counter = counter + 1
foundletter = TRUE
END IF
NEXT
IF foundletter = FALSE THEN
numberoftries = numberoftries + 1

PRINT "You have only"; (10 - numberoftries); "chances "
END IF
letter(ASC(a$) - 64) = -1
END IF
END SELECT

LOOP UNTIL a$ = CHR$(27) OR counter = LEN(wordtoguess) OR numberoftries = 8
IF counter = LEN(wordtoguess) THEN

PRINT "You won"
ELSE

PRINT "You lost"
END IF

PRINT "Do you want to play again (y/n)";
DO
again = INKEY$
LOOP UNTIL UCASE$(again) = "Y" OR UCASE$(again) = "N"
LOOP UNTIL a$ = CHR$(27) OR UCASE$(again) = "N"

I was working on a qbasic code for hangman for a computer programming class project.
 

Amorix

Member
Joined
Nov 10, 2011
Messages
236
Reaction score
756

77thShad

Ayy lmao
Joined
Jan 12, 2012
Messages
1,079
Reaction score
1,035
This is the story put together:

Night/day 1
The underground city of Molarius has seen better days. After the village of Clobule was almost destroyed due to a Zombie attack, the city officials of Molarius have hidden away the Pearls of Transformation. But it turns out hiding the Pearls of Transformation did nothing. After a high ranking official named Alpha102 was murdered, it took hours upon hours to figure out the cause. Alpha102 was struck by a bone and his brains were missing. The officials checked their Pearl of Transformation vault and discovered that they are still there. That means Pearls of Transformation are being taken from other towns! The Zombies are getting organized, that does not bode well.

The humans that inhabit the city are vital to its success. They provide the business and the manual labor of diamond mining. The town lights dim, showing night time is coming. The humans do not have time to make any decisions, so they sleep, wondering what will happen...

The redstone lamps in Molarius shut off; it is now night time in the town. The humans go to sleep in their stone brick houses.

It is now Night 1.

The Zombies decide to get up. The Enderman remain behind, not willing to risk itself on missions, while it could sit back calling the shots. The four zombies decide to target Defiant_Blob. They know he is crafty, and played a huge role in wiping out the Zombies in Clobule. One Zombie remains outside the house to make sure Defiant_Blob can not escape. The three other zombies enter the house.
***
The Skeleton is also at large, knowing Defiant_Blob is dangerous. The Skeleton sets up stakeout on a nearby underground tree. Then he sees a Zombie standing outside. But then the Skeleton sees Defiant_Blob waking up, and deduces there are Zombies in Defiant's house. The Skeleton knows things will get hairy soon, and decides not to risks getting the zombies riled up against him. The Skeleton aims at Defiant_Blob, and fires.
***
The Zombies bust into Defiant_Blob's room. Then they hear a loud TWANG!. Defiant_Blob staggers, with an arrow in his chest. The Zombies see the Skeleton outside and decide to leave him for later. The Zombies devour Defiant_Blob.
***
The Skeleton sees a dark cloaked figure approaching a Zombie. Rather than risk waiting to see what happens, it decides to make an exit.
***
The Vigilante has his best cloak on. He/she knows that dressing snappy is good for the job. He/she silently approaches a lone Zombie standing outside of Defiant_Blob's house. Quickly, the Vigilante cuts the Zombie with his knife. The zombie dies and a note on the corpse reveals it was Nottykitten! The Vigilante takes the Pearl of Transformation to give to the town as a secret donation.
***
After the three Zombies are done eating Defiant_Blob, they know he was an ordinary civilian. The Zombies leave Defiant_Blob's house to see Nottykitten murdered. They leave quietly, knowing The Godfather will not be pleased.


Defiant_Blob was a Civilian.
Nottykitten was a Zombie.

The day seemed to last forever. Everyone was accusing each other. It seemed there would be no end to the madness. killer1525 was eventually chosen as the person who seemed most suspicious. Killer1525 is led to the noose by helloworld111. Killer1525 makes a cryptic statement about him being the cop, but it is too late. A majority has been reached. Killer1525 is led to the noose, which ends up breaking because of it's shoddy design. (No offense, town archetect). The town wonders what to do now, as they thought it would work.

Helloworld111 gets an idea, and decides to tie killer up underneath a cliff. The town pushes a boulder, and it falls on killer1525, crushing his body. Helloworld111 finds a journal killer1525 wrote. It's foreign. That's right, you guys killed a foreigner! The only word helloworld111 can decipher is cop.


Killer1525 was a cop.

It is now Night 2.

Night/Day 2
The Skeleton crouches behind a stone brick roof. It watches over the public fields, thanks to its night vision it has no difficulty in watching. It bides its time, waiting for any late night walkers to come out. Surely enough, one walker does come. The walker is Marnixxie. The Skeleton quietly slides down, making sure to stay light on its bony feet. The skeleton quietly draws back its bow, taking care to aim at where Marnixxie is going to be. The Skeleton shoots. TWANG!

Marnixxie shouts wildly. "I took an arrow to the knee! Help me!"

The skeleton curses under its breath, quickly drawing another arrow. No time to aim. The Skeleton shoots, and melts into the darkness.
***
The next morning, the town crowds over Marnixxie's corpse. Arrows in both knees. It looks like Marnixxie bled to death. Just a civilian. Skeleton, learn to aim better.

There were no further kills that night.


Marnixxie was a civilian.

It is now Day 2.

Nitasu, and Hockeyfan1852, I am modkilling the two of you. Talking about this in real life and having PM's floating around that have a secret strategy is not acceptable.

Paceboys willingly steps up to the new noose,(A villager fixed it) after a tense discussion in the town that results in having the town split up between abstaining and lynching. Paceboys hangs, but the noose snaps again.(Get it right, guys) Paceboys decides the best way to go out is stabbing himself with an iron sword. Paceboys crumples to the ground, with nothing happening.

The townsfolk go to sleep after a day that seemed to have lasted forever, and with many confusing aspects to it.


Paceboys was a Civilian.

Night/Day 3
The three zombies are on the move. The Enderman is behind at the lair because things seem to be getting tricky. The zombies bust into the house of Duffie.
All three go inside the house together to avoid the incident with Nottykitten. Suddenly the redstone lamps in the house turn on all at once, due to the redstone currents within the walls. The zombies start burning, and they know time is limited. The Zombies madly rush into Duffie's room, where Duffie is standing on the other side, startled. The zombies tackle Duffie together and kill her quickly. Two of the zombies rush out of the house, with the third lagging behind.

The last zombie reaches for the door, but it is locked! The zombie bangs on the door, but slowly withers away. The zombie drops a pearl of transformation, along with its ID.

The Vigilante waits until the two zombies are away from Duffie's house. The Vigilante turns off the lights in Duffie's house with a lever. The Vigilante picks up the ID of the dead zombie after unlocking the door. The ID reads; Chillingworth.


Duffie was a Civilian.
Chillingworth was a Zombie!

It is now Day 3.

RaneofPane has now been replaced by 77_is_the_best

Rane, please do not make any more posts here.

77, I will PM you your role and instructions.

The town decides to not kill off anyone. Let's see if that was a wise decision.

It is now Night 4.

Night/Day 4

The vigilante moves fast. The vigilante knows with each passing night he grows a bigger target on his back. The vigilante then locates smelyalata. Smelyalata locks the door to her house, afraid of a zombie attack. There would be no zombie attack on smelyalata. The vigilante picks the lock and enters smelyalata's house, then creeps upstairs to smelyalata's bed. The vigilante plunges a knife into smelyalata's heart. Smelyalata turns into an Iron Golem. The vigilante curses, and takes the pearl of transformation.
***
The vigilante walks back to his/her resting place. TWANG!
The vigilante scrambles behind a rock. It is The skeleton attacking the vigilante. The vigilante grabs the knife and hurls it at the skeleton, it takes off an arm on the skeleton, preventing it from being able to use it's bow. The skeleton picks up its arm, and charges at the vigilante. The vigilante hits a lever that he/she placed there the night before, detonating several TNT blocks within the stone. Boulders and rocks fall all around the vigilante and the skeleton. The skeleton reaches the vigilante and a fast and fierce melee brawl ensures. The skeleton makes brutal swipes with its bone as a weapon, the vigilante dodges swipe after swipe. The vigilante pins the skeleton down and takes the bone weapon from it. As the vigilante prepares to kill the skeleton, the skeleton kicks the vigilante off of it and scrambles toward another lever, and presses it.

The floor cracks, deep explosions are heard, and a huge chasm opens up below. The vigilante gets up, and tosses the bone at the skeleton, smacking it in the face. The skeleton falls over, right by the chasm. The vigilante steps toward the skeleton, and the skeleton quickly grabs the dark cloak covering the vigilante. The skeleton removes it and grabs the vigilante's leg with its only arm. The skeleton swipes it's arm across, sending the vigilante down to the ground. The skeleton gets a good look at the vigilante's face. It is kraby1. The skeleton sees kraby1's eyes. kraby1 knows he was bested by the skeleton. The skeleton kicks kraby1 off into the chasm. The skeleton looks down the chasm to make sure kraby1 didn't survive, and hears a faint splat. The skeleton grabs its arm and inserts it back into its rightful socket, and walks away.


Smelyalata was an Iron Golem.
kraby1 was The Vigilante

It is now Day 4

The town decides that helloworld111 has not been active. helloworld111 is led to the cliff where the vigilante was killed off by the skeleton. balloon98 pushes helloworld111 off the cliff, where helloworld111 then grabs a pointy surface that juts out just below the cliff. The town gets angry, and throws a rock at the surface, breaking it and sending helloworld111 down. The town then remembers they need to see the body to figure out what he was. They painstakingly mine a makeshift staircase down the cliff and find helloworld111, exactly the same as when he was alive.

helloworld111 was a Civilian.

It is now Night 5

Night/Day 5

The skeleton decides to eliminate Gasy_Europeon. It moves as fast as it can, as it got a late start. The skeleton sees Gasy sitting on a bench on an artificial park. (Remember, the city of Molarius is underground.) The skeleton comes from behind Gasy, and grabs him by the mouth. It tosses gassy into the lake, letting Gasy get sucked up by the water current that leads below. Gasy_Europeon was a civilian.
***
The Enderman is sick of sitting around inside the hideout. The Enderman arrives at the artificial park, with the two remaining Zombies flanking it. The skeleton is in sight, there will be no escape.
***
The skeleton calmly leaves the park, ready to depart to its hideout. Then the skeleton casually looks to the left, and sees the enderman, coating itself in purple mist. The skeleton dashes, but the zombies block the closest exit. (The park is fenced in) The skeleton hits the enderman with an arrow, which causes the enderman to teleport. The enderman laughs, and the skeleton calmly looks around, and is forced onto the ground from behind.
***
The enderman could not be happier.
"You served us well, getting rid of the vigilante."The enderman said.
The skeleton has an icy, cold look in its eyes.
"But you've outlived your usefulness."The enderman completed.
The zombies grab the skeleton by the arms and legs, and the enderman strikes.
***
The zombies and the enderman are now at their hideout, with a few new bones as decoration. The enderman looks at the skeleton's pearl of transformation, and sees that the skeleton was Darthlego5679.


Gasy_Europeon was a Civilian.
Darthlego5679 was The Skeleton.

It is now Day 5.

Town, you are in a Mislynch and Lose situation. If you fail this day period, and the mafia gets one kill, their numbers equal yours, and that will result in a loss.

77_is_the_best is brought to the lake, where Gasy_Europeon was murdered. The town attaches an iron block to 77, so he can't swim away. The town pushes 77 into the lake, where he drowns. Nothing floats back up.

77_is_the_best was a Civilian.

If the mafia gets one kill, it is game over. It is up to other night roles to try and stop them.

It is now Night 6.

Finish on Night/Day 6

The Zombies and Enderman get ready for what may be their last night. They follow their target to the deep magma mines. The lava emits a reddish glow. This could be the end. The three look for their target, but the target is nowhere to be seen. Then they see a shadow on the wall. The mafia sneaks over to it and jumps out. But it is just a Creeper. The mafia knows the creeper won't attack them, so they take the creeper with them. But their target is nowhere in sight.
***
Ooglie101 is quickly moving through the magma mines. Ooglie knows that he is a likely target, so he decided to hide out here for the night. Ooglie arms himself with an iron sword. Ooglie peers out from the wall, and see the Enderman, Zombies, and Creeper. Ooglie knows it's only a matter of time. Ooglie dashes for the exit, but he is seen. The Enderman teleports in front of him, and ooglie violently slashes at it with his sword. The Enderman falls down, injured. The zombies chuck the creeper at ooglie, ooglie slashes the creeper, the creeper falls in front of ooglie and explodes. The stone layer leading to the exit crumbles, sending lava flowing through the new opening.

Ooglie101 sprints backward, and dissapears around the corner, knowing the two zombies are after him. He gets out his pickaxe and begins mining a way around the lava, hoping to reach the exit before the zombies get to him. Ooglie makes the path and reaches the exit. Ooglie dashes to the exit, and is smacked by a zombie. Ooglie tumbles down the stairs and winds up in front of the other zombie and the Enderman.
Enderman: It's over.
The Zombies devour Ooglie. He was an Iron Golem.
***
The next morning, the six town members meet. Jolteon42 throws the Iron Golem down in front of everyone.
Jolteon42: If my math is correct, there are three mafia members remaining. There are three civilians left. Zombies, do it now.
Thetogolopian and JKangaroo transform into Zombies. Jolteon42 transforms into the Enderman.
Harmakpaul: It's over.
Enderman: Let me see if I guess right. balloon98 was the doctor. harmakpaul and gamefan__15 were civilians. Sound correct?
The three look at each other. He was right.
Enderman: Eliminate them.
***
The town of Molarius is dark. The redstone lamps have been dismantled, and the stone bricks are cracked and mossy. Only the Enderman and the two Zombies inhabit the place now.
Zombie: Enderman, now what do we do?
Enderman: What else? We're going after other towns. We won't rest until every town in this area has been destroyed!
Zombie: What town are we hitting next?
Enderman: The village of Clobule. They bested us once. But we won't let them beat us a second time. We're going back.

THE END.


Feats;
Most decorated night role-(The role that had the most impact on nights)
Kraby1 for eliminating two mafia members.
Survivors-(the people that lived, obviously)
Jolteon42, Thetogolopian, and JKangaroo.
(umm from forum game blocktopia mafia xD omg how embarrassing)
 

Mmarz11

Former AoD Dev
Joined
Aug 6, 2011
Messages
431
Reaction score
539
Meh... don't like how it doesn't keep the formatting but whatever...

package Experiments;

import java.io.File;

public class Blah
{
public static void main(String[] args)
{
File file = new File("test");
if (!file.exists())
return;
if (file.isDirectory())
deleteDirectory(file);
else
file.delete();
}

public static void deleteDirectory(File directory)
{
for (File file : directory.listFiles())
if (file.isDirectory())
deleteDirectory(file);
else
file.delete();
directory.delete();
}
}
 

Pokemon365

Member
Joined
Aug 12, 2011
Messages
264
Reaction score
215
// Determine if a number is a prime number or not.
class PrimeNumbers_2 {
public static void main(String args[]) {
long xi, yi , numprime = 0;

for(xi = 2; xi < 1000; xi++) {
double x = xi, sqrtx = Math.sqrt(x); // Declare x to be a double version of xi, and
// sqrtx as a double variable
// The function sqrt is in the Math class
boolean prime = true; // "prime" is set to false when a factor for x is found



//////////////////////////////////////////////////////////////////////
// Only need to look for factors that are <= to the square root of x
// For every factor less than the square root there is one larger
// For example take x = 12. Factor pairs are (2,6), (3,4)
// The square root of 12 is 3.464
// As a result we only need to check factors <= the square root of x

for(yi = 2; yi <= sqrtx; yi++){

////////////////////////////////////////////////////////////////////

// If we have already found a factor and set then prime to false there is no
// reason to continue the program and look for more factors
// So we only continue checking for factors if prime is set to true

if(prime == true){

////////////////////////////////////////////////////////////////////

long zi = xi%yi; // Compute modulus of xi/yi
// If this modulus equals zero then xi is not prime
// Then set prime = false
if(zi == 0) prime = false;

}
}
///////////////////////////////////////////////////////////////////
// If the number x is prime then print it out

if ( prime == true){
System.out.print(" " + xi);
numprime = ++numprime;
}
///////////////////////////////////////////////////////////////////
}
System.out.println(); System.out.println(); System.out.println("Total number of primes found is " +
numprime);
}
}

scotty12345

I am learning java too
 
Status
Not open for further replies.
Top