This file contains hidden or 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
| package com.avighnash.arimaa; | |
| import java.awt.*; | |
| import java.awt.event.ActionEvent; | |
| import java.awt.event.ActionListener; | |
| import javax.swing.*; | |
| public class ArimaaMain implements ActionListener { |
This file contains hidden or 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
| package com.avighnash.arimaa; | |
| import java.awt.*; | |
| import java.awt.event.ActionEvent; | |
| import java.awt.event.ActionListener; | |
| import javax.swing.*; | |
| public class ArimaaMain implements ActionListener { |
This file contains hidden or 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
| let filePicker = NSOpenPanel() | |
| filePicker.canChooseFiles = false | |
| filePicker.canChooseDirectories = true | |
| filePicker.allowsMultipleSelection = false | |
| filePicker.begin { (result) -> Void in | |
| if result == NSApplication.ModalResponse.OK { | |
| let fileManager = FileManager.default | |
| do { |
This file contains hidden or 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
| func calc(of num: String, _ loops: Int = 0) -> Int { | |
| return num.count != 1 ? calc(of: String(num.compactMap({ Int(String($0)) }).reduce(0, +)), loops + 1) : loops | |
| } |
This file contains hidden or 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
| package com.avighnash.exercises | |
| object AdditivePersistence { | |
| fun calc(num: Long): Int { | |
| var x = num | |
| var i = 0 | |
| while (x.toString().toCharArray().map(Character::getNumericValue).size != 1) { | |
| x = x.toString().toCharArray().map(Character::getNumericValue).sum().toLong() | |
| i++ |
This file contains hidden or 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
| import framework.Command | |
| import framework.CommandCanister | |
| import framework.CommandHandler | |
| import framework.CommandRegister | |
| import org.apache.commons.lang3.StringUtils | |
| class ExampleCommand { | |
| @Command("/math") fun math(canister: CommandCanister) { |
This file contains hidden or 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
| class ClosureSleeve { | |
| let closure: () -> () | |
| init(attachTo: AnyObject, closure: @escaping () -> ()) { | |
| self.closure = closure | |
| objc_setAssociatedObject(attachTo, "[\(arc4random())]", self, .OBJC_ASSOCIATION_RETAIN) | |
| } | |
| @objc func invoke() { | |
| closure() |
This file contains hidden or 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
| package us.universalpvp.skinpainter.util; | |
| import org.bukkit.DyeColor; | |
| import org.bukkit.Material; | |
| import org.bukkit.inventory.ItemStack; | |
| /** | |
| * Created by avigh on 9/1/2016. | |
| */ | |
| public enum ColoredMaterial { |
This file contains hidden or 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
| package furyrider.minigame.survivalgames.handlers; | |
| public enum GameState | |
| { | |
| IN_LOBBY, IN_GAME, PRE_GAME, PRE_DM, DM, RESETTING, POST_DM; | |
| private static GameState state; | |
| public static void setState(GameState state) | |
| { |
This file contains hidden or 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
| /* | |
| Example: | |
| new BukkitRunnable() | |
| { | |
| Scroller scroller = new Scroller("&aThis is an &2important &amessage!", 16, 5, '&'); | |
| Sign sign = a-sign-from-somewhere; | |
| public void run() | |
| { |
NewerOlder