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
# Triggers when the game starts | |
on_game_start = { | |
events = { | |
} | |
} | |
on_game_start_country = { | |
events = { | |
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
" Specify a directory for plugins | |
" - For Neovim: ~/.local/share/nvim/plugged | |
" - Avoid using standard Vim directory names like 'plugin' | |
call plug#begin('~/.vim/plugged') | |
" Make sure you use a single double quote for comments | |
" Make sure you use a single single quote for values | |
" Lightline | |
Plug 'itchyny/lightline.vim' |
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
#!/bin/bash | |
ENDC='\033[0m' | |
CYAN='\033[0;36m' | |
GREEN='\033[0;32m' | |
RED='\033[0;31m' | |
YELLOW='\033[0;33m' | |
# update repositories, upgrade current packages, and remove deprecated packages | |
echo -e "${CYAN}>>> Updating, Upgrading, and Autoremoving...${ENDC}" |
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
use std::util::Random | |
pub abs trait MeleeAttackBehavior begin | |
pub abs def meleeAttack(self: &Self) -> Int | |
end | |
pub abs trait RangedAttackBehavior begin | |
pub abs def rangedAttack(self: &Self) -> Int | |
end | |
pub trait Melee3d6 impl MeleeAttackBehavior begin | |
pub def meleeAttack(self: &Melee3d6) -> Int do | |
let rnd := new Random() |
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
import java.util.Random; | |
public interface MeleeAttackBehavior { | |
public int meleeAttack(); | |
} | |
public interface RangedAttackBehavior { | |
public int rangedAttack(); | |
} | |
public class Melee3d6 implements MeleeAttackBehavior { | |
public int meleeAttack() { | |
Random rnd = new Random(); |
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
import java.util.Random; | |
public abstract class Character { | |
private int health; | |
public Character(int health) { | |
this.health = health; | |
} | |
public boolean wound(int dmg) { | |
this.health = (this.health > dmg) ? this.health-dmg : 0; | |
return this.health == 0; | |
} |
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
class Array | |
def prod | |
if self.length == 0 | |
return 0 | |
end | |
z = 1 | |
self.each do |a_i| | |
z *= a_i | |
end | |
return z |
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
# python 3.6.5 | |
# from typing import List | |
def prod( A: List[int] ) -> int: | |
""" Computes the product of the elements of A. """ | |
if A == None or len(A) == 0: | |
return 0 | |
z: int = 1 | |
for a in A: | |
z *= a | |
return z |
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
# python 3.6.5 | |
# from typing import List | |
def PrimesGen( N: int ) -> List[int]: | |
""" Generates the first N primes starting with 2. """ | |
P: List[int] = [] | |
i: int = 2 | |
while len(P) < N: | |
is_prime: boolean = True | |
for p in P: | |
if i % p == 0: |
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
# python 3.6.5 | |
# from typing import List | |
def Primes( N: int ) -> List[int]: | |
""" Generates a complete list of primes P s.t. for all p in P, p < N. """ | |
P: List[int] = [] | |
A: List[int] = [ n+1 for n in range( N ) ] | |
for n in range( 1, N+1 ): | |
if A[n-1] == 1: | |
continue | |
P.append( A[n-1] ) |
NewerOlder