<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.kraut.space/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://wiki.kraut.space/feed.php">
        <title>Krautspace – Der Hackspace in Jena - hswiki:archiv:veranstaltungen:2014:python</title>
        <description></description>
        <link>https://wiki.kraut.space/</link>
        <image rdf:resource="https://wiki.kraut.space/_media/wiki:dokuwiki.svg" />
       <dc:date>2026-04-30T04:07:37+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://wiki.kraut.space/hswiki:archiv:veranstaltungen:2014:python:python-gaming"/>
                <rdf:li rdf:resource="https://wiki.kraut.space/hswiki:archiv:veranstaltungen:2014:python:python-gaming2"/>
                <rdf:li rdf:resource="https://wiki.kraut.space/hswiki:archiv:veranstaltungen:2014:python:start"/>
                <rdf:li rdf:resource="https://wiki.kraut.space/hswiki:archiv:veranstaltungen:2014:python:tictactoe"/>
                <rdf:li rdf:resource="https://wiki.kraut.space/hswiki:archiv:veranstaltungen:2014:python:transkript"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://wiki.kraut.space/_media/wiki:dokuwiki.svg">
        <title>Krautspace – Der Hackspace in Jena</title>
        <link>https://wiki.kraut.space/</link>
        <url>https://wiki.kraut.space/_media/wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="https://wiki.kraut.space/hswiki:archiv:veranstaltungen:2014:python:python-gaming">
        <dc:format>text/html</dc:format>
        <dc:date>2020-08-01T21:11:15+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>python-gaming</title>
        <link>https://wiki.kraut.space/hswiki:archiv:veranstaltungen:2014:python:python-gaming</link>
        <description>#!/usr/bin/env python3

from itertools import chain

class Game:
    &quot;&quot;&quot;Abstract base class for games&quot;&quot;&quot;
    def finished(self):
        &quot;&quot;&quot;Returns True if no more moves are to be played, False
        otherwise.&quot;&quot;&quot;
        raise NotImplementedError()

    def current_player(self):
        &quot;&quot;&quot;Return an int corresponding to the player who has to do the next
        move. Returns 0 or 1 for player1 or player2 respectively.&quot;&quot;&quot;
        raise NotImplementedError()

    def move(self, move):
        &quot;…</description>
    </item>
    <item rdf:about="https://wiki.kraut.space/hswiki:archiv:veranstaltungen:2014:python:python-gaming2">
        <dc:format>text/html</dc:format>
        <dc:date>2020-08-01T21:11:15+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>python-gaming2</title>
        <link>https://wiki.kraut.space/hswiki:archiv:veranstaltungen:2014:python:python-gaming2</link>
        <description>#!/usr/bin/env python3

&quot;&quot;&quot;Sample implementation for Python Workshop at the Krautspace.&quot;&quot;&quot;

from itertools import chain
from copy import deepcopy

SYMBOLS = (&quot; &quot;, &quot;X&quot;, &quot;O&quot;)
PLAYER1 = 1
PLAYER2 = 2
PLAYERS = (PLAYER1, PLAYER2)

def game_to_str(game):
    &quot;&quot;&quot;Convert a game state into a string.&quot;&quot;&quot;
    lines = (&quot;|&quot;.join(SYMBOLS[pos] for pos in row)
             for row in game)
    lines = reversed(tuple(&quot;{} {}&quot;.format(num + 1, line)
                      for num, line in enumerate(lines)))
    retu…</description>
    </item>
    <item rdf:about="https://wiki.kraut.space/hswiki:archiv:veranstaltungen:2014:python:start">
        <dc:format>text/html</dc:format>
        <dc:date>2020-08-01T21:11:15+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>start</title>
        <link>https://wiki.kraut.space/hswiki:archiv:veranstaltungen:2014:python:start</link>
        <description>Python-Workshop

Version 1

	*  Transkript zur Syntax
	*  Gerüst zu Spielen
	*  TicTacToe-KI

Version 2

	*  Gerüst zu Spielen</description>
    </item>
    <item rdf:about="https://wiki.kraut.space/hswiki:archiv:veranstaltungen:2014:python:tictactoe">
        <dc:format>text/html</dc:format>
        <dc:date>2020-08-01T21:11:15+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>tictactoe</title>
        <link>https://wiki.kraut.space/hswiki:archiv:veranstaltungen:2014:python:tictactoe</link>
        <description>Tic-Tac-Toe

Ein kleines Spielchen in Python: 


class ValuatingTicTacToeAI(Player):
    def stringify(self, pos):
        return chr(pos[1] + 97) + chr(pos[0] + 49)

    def compute_move(self, game):
        me = game.current_player() + 1
        valuation = [[0 for _ in range(3)] for _ in range(3)]
        for r, c in [(r, c) for r in range(3) for c in range(3)]:
            if game.board[r][c]:
                valuation[r][c] -= 100000
        positions = [[((i, j), game.board[i][j]) for j in…</description>
    </item>
    <item rdf:about="https://wiki.kraut.space/hswiki:archiv:veranstaltungen:2014:python:transkript">
        <dc:format>text/html</dc:format>
        <dc:date>2020-08-01T21:11:16+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>transkript</title>
        <link>https://wiki.kraut.space/hswiki:archiv:veranstaltungen:2014:python:transkript</link>
        <description>Python-Workshop -- Transkript Syntax


# Ausgabe
print(&quot;Hello World&quot;)

# Bloecke mittels Whitespace
if True:
    print(&quot;A&quot;)
    print(&quot;B&quot;)
print(&quot;C&quot;)

# Auf andere Module zugreifen
import string
print(string.ascii_letters)

# Variablennamen
variable = 1
variable2 = 2
var_Var = 3
# nicht: 2variable
# interne Variablen mit Unterstrich
_variable = 4

# Standardtypen: int, float, bool, str, None
number = 1
num = int(&quot;12&quot;)
fract = 1.2
mybool = True
otherbool = False and False
mystr = &quot;München \&quot;Hallo…</description>
    </item>
</rdf:RDF>
