Skip to content

Instantly share code, notes, and snippets.

import sugar, sequtils, algorithm, sets, lists
import random
#randomize()
type
Field = array[16, int]
Dir = enum →, ←, ↑, ↓, NOP
OperationCode = tuple[dir: Dir, line: int]
FieldPathInfo = tuple[rate: int, v: Field, prev: Field, level: int, operation: OperationCode]
OpenList = object
import httpclient, strtabs, json, cgi, strutils, strformat
import locks, os
const
LOGIN = YOUR_LOGIN
PASS = YOU_PASSWORD
ApiUrl = "https://api.vk.com/method/"
ApiVer* = "5.85"
AuthScope = "all"
ClientId = "3140623"
import nimpy
import sugar, sequtils, algorithm, sets, lists
import random
randomize()
type
Field = array[16, int]
Dir = enum →, ←, ↑, ↓, NOP
OperationCode = tuple[dir: Dir, line: int]
FieldPathInfo = tuple[rate: int, v: Field, prev: Field, level: int, operation: OperationCode]
from tkinter import *
systems = {
"bulletStartDyingSystem" : ["startDyingComponent", "spineComponent", "bulletComponent", "dyingAnimationComponent"],
"checkGameoverSystem" : ["playerFlagComponent", "enemiesStatComponent"],
"checkMaxEnemiesSystem" : ["enemiesStatComponent", "maxEnemiesOnScreenComponent"],
"checkPauseSystem" : ["pauseComponent"],
"collideEnemiesSystem" : ["enemyComponent", "bulletComponent", "hpComponent", "startDyingComponent", "collideComponent", "playerFlagComponent", "invulnerabilityComponent", "spineComponent"],
"createDialogSystem" : ["enemiesStatComponent"],
"dyingAnimationSystem" : ["dyingAnimationComponent", "removeNodeComponent"],
from random import shuffle
def Right(m,line):
n = m[:]
plus = line*4
n[0+plus],n[1+plus],n[2+plus],n[3+plus] = n[3+plus],n[0+plus],n[1+plus],n[2+plus]
return n
def Left(m,line):
n = m[:]
import sugar, sequtils, itertools, algorithm, sets
import random
randomize()
type
Field = array[16, int]
Dir = enum →, ←, ↑, ↓, NOP
OperationCode = tuple[dir: Dir, line: int]
FieldPathInfo = tuple[rate: int, v:Field, prev:Field, level:int, operation: OperationCode]
@spiiin
spiiin / testAtSave.lua
Created February 24, 2019 09:49
test emu.framecount
--get and print framecount for save 1 and save 2
function atSave(i)
print("Save to slot: "..tostring(i))
local curSave = savestate.create()
savestate.save(curSave)
savestate.load(savestate.create(2))
print("Save 1 frame: "..tostring(emu.framecount()))
savestate.load(curSave) -- need to reload for right value of framecount() for savestate
from beem.comment import Comment
from beem.account import Account
c = Comment("@pinkwonder/water-combo-and-gold-sea-genie-giweaway")
replies = c.get_all_replies()
participants = []
for reply in replies:
body = reply["body"]
if body.find("https://steemmonsters.com?battle=")!=-1:
participants.append("@"+reply["author"])
@spiiin
spiiin / Nes_game_list.txt
Created February 4, 2019 15:12
Best of nes games
8 Eyes (U) [!].nes
Abadox (J).nes
Addams Family, The (E) [!].nes
Adventures in the Magic Kingdom (E) [!].nes
Adventures of Lolo (U) [!].nes
Aladdin 4 (1996) (Unl) [!].nes
Alien 3 (E) [!].nes
Alien Syndrome (J).nes
Antarctic Adventure (J).nes
Astyanax (U) [!].nes
@spiiin
spiiin / find_gold_cards.py
Created January 14, 2019 04:18
Using steemmonsters python library for winning Gold Card in contest
import steemmonsters.api
from itertools import permutations
import hashlib
api = steemmonsters.api.Api()
#get info about cards
cards_details = api.get_card_details()
#debug print of card info