This file contains hidden or 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
| # Skeleton Program code for the AQA COMP1 Summer 2015 examination | |
| # this code should be used in conjunction with the Preliminary Material | |
| # written by the AQA COMP1 Programmer Team | |
| # developed in the Python 3.4 programming environment | |
| import sys | |
| BOARDDIMENSION = 8 | |
This file contains hidden or 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
| string = 'wewladaeiou' | |
| print([*filter((lambda a: a.lower() in 'aeiou'), string)][-1]) |
This file contains hidden or 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
| # Skeleton Program code for the AQA COMP1 Summer 2015 examination | |
| # this code should be used in conjunction with the Preliminary Material | |
| # written by the AQA COMP1 Programmer Team | |
| # developed in the Python 3.4 programming environment | |
| import sys | |
| BOARDDIMENSION = 8 | |
| DEBUG = False # enable debug printing |
This file contains hidden or 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
| class pieces(object): | |
| piece_dict = {} | |
| def piece(func): | |
| def predicate(): | |
| piece_dict[func.__name__] = func | |
| return predicate | |
| return func | |
This file contains hidden or 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 generate_fen(board :list=list(), turn :str='W'): | |
| def format_rank(rank :list): | |
| return map(lambda x: x[1].__getattribute__({"B":"lower", "W":"upper"}[x[0]])() if str(x).isalpha() else None, rank) | |
| def collate_rank(rank :list): | |
| string = [[k, list(g)] for k,g in groupby(format_rank(rank[1:]))] | |
| return str().join(map(lambda x: str(len(x[1])) if not x[0] else str().join(x[1]), string)) |
This file contains hidden or 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
| class cpu_commands(object): | |
| def add(self, memory_loc, value): | |
| self.memory[int(memory_loc)] += self.interpret_address(value) | |
| class cpu(cpu_commands): | |
| def __init__(self, initial_size): | |
| self.memory = [0 for i in range(initial_size)] | |
| self.commands = cpu_commands | |
| def run_command(self, string): |
This file contains hidden or 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 org.raspberrypi.WeatherStation; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.net.ProtocolException; | |
| import java.net.URL; | |
| import java.sql.Connection; | |
| import java.sql.DriverManager; | |
| import java.sql.PreparedStatement; | |
| import java.sql.ResultSet; |
This file contains hidden or 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 asyncio | |
| import discord | |
| from discord.ext import commands | |
| class PoopBot(commands.Bot): | |
| def __init__(self, token): | |
| super().__init__(description="poop bot", command_prefix=None) |
This file contains hidden or 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
| /* | |
| freak fortress 2 status, written by nitros | |
| */ | |
| #pragma semicolon 1 | |
| #include <sourcemod> | |
| #include <freak_fortress_2> |
This file contains hidden or 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 enum | |
| from itertools import product | |
| class bools(enum.Enum): | |
| true = 1 | |
| false = 0 | |
| class gate: | |
| rules = {} |
OlderNewer