Skip to content

Instantly share code, notes, and snippets.

View abner-math's full-sized avatar
🤖
DON'T PANIC!

Abner Matheus Araujo abner-math

🤖
DON'T PANIC!
View GitHub Profile
@abner-math
abner-math / ninpou2_simulator.py
Last active November 23, 2023 23:17
ninpou2_simulator
from enum import Enum
# DOTA Constraints
MAX_LEVEL = 50
HP_PER_TAI = 22.0
CHAKRA_PER_GEN = 12
STARTING_MAGIC_RESIST = 0.25
MAGIC_RESIST_PER_GEN = 0.001
XP_REQUIRED = [0, 0]
for i in range(1, MAX_LEVEL):
@abner-math
abner-math / amaterasu.lua
Last active November 14, 2023 21:00
Sasuke Amaterasu
--[[
Author: PicoleDeLimao
Date: 11.14.2023
Implement Sasuke Amaterasu ability
]]
function SpellStart(event)
local caster = event.caster
local ability = event.ability
local target = event.target_points[1]
public class Developer {
private Role role;
protected void setRole(Role role) {
this.role = role;
}
public double getSalary() {
return this.role.getSalary();
public class Senior implements Role {
@Override
public double getSalary() {
return 4000;
}
@Override
public boolean promote(Developer context) {
return false;
public class Expert implements Role {
@Override
public double getSalary() {
return 2000;
}
@Override
public boolean promote(Developer context) {
context.setRole(new Senior());
public class Junior implements Role {
@Override
public double getSalary() {
return 1000;
}
@Override
public boolean promote(Developer context) {
context.setRole(new Expert());
public class Trainee implements Role {
@Override
public double getSalary() {
return 500;
}
@Override
public boolean promote(Developer context) {
context.setRole(new Junior());
public interface Role {
public double getSalary();
public boolean promote(Developer context);
}
public class Developer {
private Role role;
public double getSalary() {
switch(this.role) {
case TRAINEE:
return 500;
case JUNIOR:
return 1000;
public enum Role {
TRAINEE, JUNIOR, EXPERT, SENIOR
}