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 cairo | |
import pygame | |
import sys | |
SIZE = (400, 400) | |
def draw_frame(cairo_context, position): | |
cairo_context.set_source_rgb(1, 0, 0) | |
cairo_context.rectangle(position, position, 10, 10) | |
cairo_context.fill() |
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
from unittest.mock import Mock | |
import unittest.mock | |
import doctest | |
class Calculator: | |
""" | |
>>> mock_display = Mock(Display) | |
>>> calculator = Calculator(mock_display) | |
>>> calculator.add(3) |
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 itertools | |
class World: | |
def __init__(self, interactions): | |
self.objects = [] | |
self.interactions = interactions | |
def add(self, item): | |
self.objects.append(item) |
OlderNewer