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
# Author: Evert Heylen | |
# Date: 09.10.2014 | |
# call the program with 'color' as an argument to have red input like in | |
# the Assignment file! | |
# call the program with 'exp' to use the experimental faster function | |
# The previous assignment had example output in Dutch, this one has the example output in English, so | |
# I've edited my helper fucntions accordingly. |
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 math | |
defaultbits = 8 | |
def char_to_int(s): | |
return int(s, 36) | |
def int_to_char(i): | |
if 0 <= i <= 9: | |
return str(i) |
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
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
s := []bool{false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, | |
true, true, true, true, true, true, true, true, true, true, true, true, true, true, true} |
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
# A basic function works like this: | |
def A_times_B_plus_C(a, b, c): | |
return (a*b) + c | |
# a, b and c are positional arguments. I define them by putting a value in the right place. | |
print(A_times_B_plus_C(5, 10, 6)) # == 56 | |
# however, as functions grow large, they might have a lot of parameters, and you don't want to |
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
Stel u voor; een simpele tabel van pagina's. | |
+-----+-----------------------------------------+ | |
| nr | tekst | | |
+=====+=========================================+ | |
| 1 | "pagina 1 tekst...." | | |
+-----+-----------------------------------------+ | |
| 2 | "pagina 2 tekst...." | | |
+-----+-----------------------------------------+ | |
| 5 | "pagina 5 tekst...." | |
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
def searchValues(values, attr, key): | |
for v in values: | |
if v.__dict__[attr] == key: | |
return v |
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
Game is Xonotic using base gamedir data | |
gamename for server filtering: Xonotic | |
Xonotic Linux 21:47:07 Jan 18 2015 - release | |
Skeletal animation uses SSE code path | |
DPSOFTRAST available (SSE2 instructions detected) | |
Failed to init SDL joystick subsystem: | |
execing quake.rc | |
execing default.cfg | |
execing defaultXonotic.cfg | |
execing sRGB-disable.cfg |
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
set stack {} | |
while 1 { | |
puts "{ $stack }" | |
set input [gets stdin] | |
if {$input in {+ - * /}} { | |
# calculate new_element (trick with parsing input as part of the command) | |
set new_element [eval [list tcl::mathop::$input [lindex $stack [expr {[llength $stack] - 1}]] [lindex $stack [expr {[llength $stack] - 2}]]]] | |
# remove previous values |
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
# ----[ Settings ]------------ | |
x = 500 | |
coca_eur = 100 | |
xtc_eur = 650 | |
wiet_eur = 300 | |
startgeld = 200 |
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
#!/usr/bin/python3 | |
# HOE TE GEBRUIKEN: | |
# ./convert.py Speelveld.xml | |
# Om Bewegingen.xml om te zetten naar Acties.xml; all hail the console! | |
# mv Bewegingen.xml Acties.xml | |
# sed -i "s/SPELERNAAM/ID/g" Acties.xml | |
# sed -i "s/BEWEGINGEN/ACTIES/g" Acties.xml |
OlderNewer