This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void takeVote() | |
{ | |
World[] voteWorlds = PropHuntWorlds.OrderBy(x => randWorld.Next()) | |
.Take(3) | |
.ToArray(); | |
NewVote(); | |
Server.Players.Message("&S--------------------------------------------------------------"); | |
Server.Players.Message("Vote for the next map!"); | |
Server.Players.Message("&S/Vote &c1&S for {0}&S, &c2&S for {1}&S, and &c3&S for {2}", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// step 1: find index of largest value | |
// If there is a tie, the last of the tied worlds will be chosen | |
World chosenWorld; | |
int maxVotes = int.MinValue, i = 0; | |
foreach (int votes in voteList) { | |
if ((chosenWorld == null) || (votes > maxVotes)) { | |
maxVotes = votes; | |
chosenWorld = worldList[i]; | |
} | |
i++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { //1. main method. In the main program declare a Scanner variable that is hooked up to System.in. | |
//You need to include the line of code import java.util.Scanner; at the top of your program. Pass the Scanner object you create as a | |
//parameter to any methods that need it. | |
//The main method should not have a lot of statements, instead it shall call other methods. | |
RockPaperScissors(); | |
} | |
public static void RockPaperScissors() { | |
System.out.println("Welcome to Rock Paper Scissors. I, Computer, will be your opponent."); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace BucketSort | |
{ | |
class Program | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using Microsoft.Xna.Framework; | |
namespace ShipGame | |
{ | |
class MiniBoss : EnemyShip | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace DiceRoll | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
const double percentIncrease = 0.09; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ConsoleApplication1 //this is from Deitel Exercises 6.9 – 6.12, 6.19, 6.21, 6.26 | |
{ //To be specific, it's number 6.11 | |
class Program | |
{ | |
public static void Main( string[] args ) | |
{ | |
Console.WriteLine( "Enter however many integers out of which you would like the smallest divined:" ); | |
int howManyInts = Convert.ToInt32( Console.ReadLine() ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region Emotes | |
public struct EmoteData //Contains all data needed for the emotes. Emote is the trigger word, | |
//example (bullet). ID is the byte value of the char | |
{ | |
public string Emote; | |
public byte ID; | |
} | |
//this list will be loaded with the list of emotes and their replacement values | |
static List<EmoteData> EmoteTriggers = null; |