View validatePIN.js
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
function validatePIN(pin) { | |
return /^(\d{4}|\d{6})$/.test(pin) | |
} |
View ConfigFile.cs
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.Configuration; | |
namespace Yallr.src.game | |
{ | |
class ConfigFile | |
{ | |
Configuration configManager = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); | |
KeyValueConfigurationCollection confCollection; |
View ConfigFileJSON.cs
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 class ConfigFile | |
{ | |
public int someconfig = 10; | |
public static ConfigFile Read(string path) | |
{ | |
if (!File.Exists(path)) | |
{ | |
ConfigFile config = new ConfigFile(); |
View bulmaformhandler.js
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
/* | |
Copyright 2018 Ryozuki | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
View formhandler.js
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
/* | |
Copyright 2018 Ryozuki | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
View compare.cpp
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
#include <cmath> | |
bool compareDigit(int a, int b, int n) | |
{ | |
return (a - (a % (int)pow(10, n - 1))) % (int)pow(10, n) == (b - (b % (int)pow(10, n - 1))) % (int)pow(10, n); | |
} | |
// compareDigit(234, 134, 1) == true (4 == 4) | |
// compareDigit(234, 134, 3) == false (2 != 1) |
View hackmud_chess.play.js
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
function(c, a) | |
{ | |
a = a || {} | |
var r = #fs.multivac.renderer() | |
var clone = #fs.scripts.lib().clone | |
var log = [] | |
var squareWidth = 9 | |
var squareHeight = 7 | |
var boardRect = r.Rect(2, 2, 8 * squareWidth, 8 * squareHeight) | |
const words = "abcdefgh" |
View hackmud_multivac.renderer.js
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
function(context, a) | |
{ | |
a = a || {} | |
var internalBuffer = [] | |
var charPatterns = { | |
a: [ | |
[0, 0, 1, 0, 0], | |
[0, 1, 0, 1, 0], | |
[1, 0, 0, 0, 1], |
View Numerical_valleys.cpp
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
#include <iostream> | |
using namespace std; | |
int number_of_digits(int n) { | |
if(n < 10) | |
return 1; | |
return 1 + number_of_digits(n / 10); | |
} |
View battlecode.d.ts
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
// Type definitions for battlecode | |
// Project: battlecode.org 2019 | |
// Definitions by: Ryozuki <Discord: Ryozuki#1984> | |
// Thanks to the docs https://battlecode.org/dash/docs | |
declare module "battlecode" { | |
export enum SPECS { | |
CASTLE, | |
CHURCH, | |
PILGRIM, |
OlderNewer