Skip to content

Instantly share code, notes, and snippets.

View mstefarov's full-sized avatar

Matvei Stefarov mstefarov

View GitHub Profile
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}",
// 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++;
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.");
@mstefarov
mstefarov / test.cs
Last active December 16, 2015 06:39 — forked from anonymous/test.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BucketSort
{
class Program
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
namespace ShipGame
{
class MiniBoss : EnemyShip
{
@mstefarov
mstefarov / diceroll.cs
Created November 30, 2012 06:14 — forked from anonymous/diceroll.cs
Dicerolling!
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DiceRoll
{
class Program
{
static void Main(string[] args)
@mstefarov
mstefarov / salarycounter.cs
Created November 30, 2012 04:01 — forked from anonymous/salarycounter.cs
Counts the amount of pay grades in each category.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
const double percentIncrease = 0.09;
@mstefarov
mstefarov / test.cs
Created November 15, 2012 23:19 — forked from anonymous/test.cs
Newest Version of the harder one
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() );
@mstefarov
mstefarov / gist:3768570
Created September 23, 2012 02:16 — forked from Jonty800/gist:3768171
4 scootiepie xxxxxxxxxx
#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;