Skip to content

Instantly share code, notes, and snippets.

View kooi's full-sized avatar

Mark Kooijman kooi

  • Barlaeusgymnasium
View GitHub Profile
import numpy
import json
new_population = new_population = numpy.random.uniform(low=-4.0, high=4.0, size=(8,4) )
# Loop over population, extracting data
list = []
for org in new_population:
row = []
for w in org:
@kooi
kooi / game_patch.py
Created May 18, 2020 08:07
game_patch isSet opzetje
from setkaart import SetKaart
def isSet(self, kaart1, kaart2, kaart3):
"""
Returnt de waarde True als kaart1, kaart2 en kaart3 een set vormen en anders returnt het de waarde False.
Om mee te beginnen zal het elke 3 kaarten als niet een set aanduiden (met return False).
"""
hoeveelheid_correct = False
@kooi
kooi / game_patch.py
Created May 18, 2020 07:32
game_patch.py met werkende maakSet()
from setkaart import SetKaart
def isSet(self, kaart1, kaart2, kaart3):
"""
Returnt de waarde True als kaart1, kaart2 en kaart3 een set vormen en anders returnt het de waarde False.
Om mee te beginnen zal het elke 3 kaarten als niet een set aanduiden (met return False).
"""
return True
@kooi
kooi / game_patch.py
Created May 15, 2020 08:53
game_patch.py (1prD 20200515-1052)
from setkaart import SetKaart
def isSet(self, kaart1, kaart2, kaart3):
"""
Returnt de waarde True als kaart1, kaart2 en kaart3 een set vormen en anders returnt het de waarde False.
Om mee te beginnen zal het elke 3 kaarten als niet een set aanduiden (met return False).
"""
return True
@kooi
kooi / game_patch.py
Created May 11, 2020 08:05
game_patch deel 1 maakSet() met werkende hoeveelheid
from setkaart import SetKaart
def isSet(self, kaart1, kaart2, kaart3):
"""
Returnt de waarde True als kaart1, kaart2 en kaart3 een set vormen en anders returnt het de waarde False.
Om mee te beginnen zal het elke 3 kaarten als niet een set aanduiden (met return False).
"""
return True
@kooi
kooi / game_patch.py
Created May 11, 2020 07:54
game_patch deel 1 maakSet() met werkende hoeveelheid als de hoeveelheden hetzelfde zijn
def maakSet(self, kaart1, kaart2):
"""
Returnt de vereiste kaart om een set te maken. De eigenschappen van de kaarten kun je opvragen met:
kaart1.hoeveelheid, kaart1.kleur, kaart1.vorm, kaart1.vulling en
kaart2.hoeveelheid, kaart2.kleur, kaart2.vorm, kaart2.vulling en
Als bijvoorbeeld
maakSet( SetKaart(1,1,1,1), SetKaart(2,2,2,2) ) aangeroepen wordt dan geldt:
kaart1.hoeveelheid = 1
kaart1.kleur = 1
kaart1.vorm = 1
@kooi
kooi / starwars.py
Created February 4, 2019 20:51 — forked from stestagg/starwars.py
micropython starwars
import gc
import machine
import pyb
import time
import network
# Configure GPIO pins 0 and 2 to be used for
# the I²C interface
iic = machine.I2C(pyb.Pin(2), pyb.Pin(0))
@kooi
kooi / submit.md
Created December 9, 2018 18:37 — forked from tanaikech/submit.md
Uploading Local Files to Google Drive without Authorization using HTML Form

Uploading Local Files to Google Drive without Authorization using HTML Form

This is a sample script for uploading local file to Google Drive without the authorization using HTML form. A selected file in your local PC using HTML form is uploaded to Google Drive and saved to Google Drive.

When you use this, at first, please deploy Web Apps. The script is doPost() of following scripts.

Script : Google Apps Script

function doPost(e) {
 var data = Utilities.base64Decode(e.parameters.data);
@kooi
kooi / submit.md
Created December 9, 2018 18:37 — forked from tanaikech/submit.md
Downloading Files From Google Drive Under No Authorization Using Browser

Downloading Files From Google Drive Under No Authorization Using Browser

This is a sample script for downloading files from Google Drive under no authorization using browser. By using this sample, you can make other users download files from your Google Drive. Even if the other users are not Google users, they can download the files.

Demo

Manchester CoderDojo Sep 2017 - Micro:bit Radios

Introduction

This time we're going to play with the radio on the Micro:bit. We're also going to use the https://makecode.microbit.org/ editor to see if that makes it easy to get started.

We're going to work our way to a radio based hide-and-seek game. Here are the steps: