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
| // This is a C# port of @karpathy microgpt python script (https://gist.github.com/karpathy/8627fe009c40f57531cb18360106ce95) | |
| // It's the closest I could get using C#. | |
| // Use with caution as it could be wrong, but it does seem to get similar outputs | |
| namespace MicroGpt; | |
| public class Value(double data, Value[]? children = null) | |
| { | |
| private readonly Value[] _children = children ?? []; | |
| private Action _backward = () => { }; |
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
| """ | |
| The most atomic way to train and inference a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |
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> | |
| void carve_file(const char *input_file, const char *output_file, size_t start_byte, size_t end_byte){ | |
| FILE *file_in = NULL; | |
| FILE *file_out = NULL; | |
| file_in = fopen(input_file, "rb"); | |
| if (!file_in) { | |
| printf("Failed to open input file - %s\n", input_file); | |
| goto defer; |
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
| #define NOB_IMPLEMENTATION | |
| // #define NOB_STRIP_PREFIX | |
| #define NOB_WARN_DEPRECATED | |
| #include "nob.h" // https://github.com/tsoding/nob.h | |
| #include <stdio.h> | |
| #include <string.h> | |
| #define PROJECT_NAME "NoBuild_Raylib" | |
| #define BUILD_FOLDER "build/" |
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 <stdlib.h> | |
| #ifdef _WIN32 | |
| #include <windows.h> | |
| #else | |
| #include <time.h> | |
| #endif | |
| static double timer_start = 0.0; |
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
| cmake_minimum_required(VERSION 3.12) | |
| include(FetchContent) | |
| set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | |
| set(CMAKE_CXX_STANDARD 17) | |
| # SDL3 ______________________________________________ | |
| FetchContent_Declare( | |
| sdl3 |
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
| cmake_minimum_required(VERSION 3.28) | |
| include(FetchContent) | |
| set(ProjectName RaylibTemplate) | |
| project(${ProjectName} LANGUAGES C CXX) | |
| # Raylib _______________________________________ | |
| FetchContent_Declare( | |
| raylib | |
| DOWNLOAD_EXTRACT_TIMESTAMP OFF |
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
| cmake_minimum_required(VERSION 3.12) | |
| include(FetchContent) | |
| set(PROJECT_NAME Sdl3Template) | |
| project(${PROJECT_NAME}) | |
| # ? | |
| set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | |
| set(CMAKE_CXX_STANDARD 17) |
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
| cmake_minimum_required(VERSION 3.12) | |
| include(FetchContent) | |
| set(PROJECT_NAME SfmlTemplate) | |
| project(${PROJECT_NAME} VERSION 1.0.0 LANGUAGES CXX) | |
| set(CMAKE_CXX_STANDARD 17) |
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
| cmake_minimum_required(VERSION 3.28) | |
| include(FetchContent) | |
| # NAME | |
| set(PROJECT_NAME RaylibTemplate) | |
| project(${PROJECT_NAME} LANGUAGES C) | |
| set(CMAKE_C_STANDARD 99) | |
| # set(CMAKE_CXX_STANDARD 17) |
NewerOlder