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
| globals [ score can-turn food-x food-y wall-rot ] | |
| patches-own [ is-wall? is-extra-food? patch-life ] | |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| ;;; GETTING PATCH INFORMATION ;;; | |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| ; Get the life left in a patch | |
| to-report get-patch-life |
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
| ;;; CAMERA STUFF ;;; | |
| to-report get-xcord [ x ] | |
| report (x / zoom) + x-cam | |
| end | |
| to-report get-ycord [ y ] | |
| report (y / zoom) + y-cam | |
| end | |
| ;;; COLORING ;;; |
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
| globals [ score can-turn food-x food-y ] | |
| patches-own [ patch-life ] | |
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
| ;;; UPDATING PATCHES COLORS ;;; | |
| to-report is-touching-food | |
| report distancexy food-x food-y < 1 | |
| end |
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
| from Crypto.Cipher import AES # Encryption | |
| import hashlib # Turn user password into key | |
| # Get key based on user password | |
| def generate_key(password, key_len, salt=b'steven_is_really_lame', iterations=262144): | |
| # Use hmac to generate key based on user password | |
| hash = hashlib.pbkdf2_hmac('sha256', bytes(password), bytes(salt), iterations, key_len) | |
| return bytes(hash) | |
| # Default nonce for every |
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
| #include <stdio.h> | |
| #include <stddef.h> | |
| #include <stdlib.h> | |
| #define BUFFER_SIZE 0x10000 | |
| int write_getline(FILE* file) | |
| { | |
| // buffer | |
| static char buffer[BUFFER_SIZE]; |
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
| /** | |
| * Copyright 2019 Sam Robert Belliveau | |
| * | |
| * Permission is hereby granted, free of charge, to any person | |
| * obtaining a copy of this software and associated documentation | |
| * files (the "Software"), to deal in the Software without restriction, | |
| * including without limitation the rights to use, copy, modify, merge, | |
| * publish, distribute, sublicense, and/or sell copies of the Software, | |
| * and to permit persons to whom the Software is furnished to do so, | |
| * subject to the following conditions: |
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
| /** | |
| * MIT License | |
| * | |
| * Copyright (c) Sep 2019, Samuel Robert Belliveau | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
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
| /** | |
| * MIT License | |
| * | |
| * Copyright (c) 2021, Samuel Robert Belliveau | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |
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
| #ifndef SAM_BELLIVEAU_RAW_BYTE_CONTAINTER | |
| #define SAM_BELLIVEAU_RAW_BYTE_CONTAINTER 1 | |
| #include <cstdint> // Size Types | |
| #include <cstring> // std::memcpy | |
| #include <exception> // std::overflow | |
| #include <initializer_list> // std::initializer_list | |
| #include <iterator> // Iterator stuff | |
| template<class InputType> |
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
| from PIL import Image | |
| # Store letter in a pixel of the image | |
| def StoreLetter(pixel, letter): | |
| # Make a copy of the image | |
| r, g, b = pixel | |
| # Clear out the bottom bits | |
| r &= 0b11111000 | |
| g &= 0b11111100 |