Skip to content

Instantly share code, notes, and snippets.

View shouth's full-sized avatar
💭
🤩

Shota Minami shouth

💭
🤩
View GitHub Profile

これは何

ソフトウェア工学の課題でHello, world!難読化の課題が出たので面白がってやってたら何個かできたので紹介するよ! 授業では課題の提出物から何個かピックアップされて紹介されてたけど,作者はこの課題の締切には間に合わせたけど提出が遅かったからピックアップの対象の中に入ってさえいなかったよ!ちょっと悲しいね!

各プログラムの解説を途中まで書いてたけどめんどくさくなってきたから各プログラムの紹介で読解のためのヒント出す程度に留めることにするよ!

ただ読解するにも通常とはやや異なる書き方をしている部分があるから先にそこの説明だけしておくよ!

C言語では

// ==UserScript==
// @name AtCoder Better Highlighter
// @name:en AtCoder Better Highlighter
// @namespace https://shouth.net/
// @version 0.5.4
// @description highlight.jsを使用してAtCoderの提出コードの表示を置き換えるUserScriptです.
// @description:en Better syntax highlighting for AtCoder using highlight.js.
// @author shouth
// @resource css https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.2/styles/default.min.css
// @require https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.2/highlight.min.js
@shouth
shouth / cpuboard.c
Last active May 23, 2024 22:48
プロジェクト実習2で作成したCPUシミュレータです
/*
* Project-based Learning II (CPU)
*
* Program: instruction set simulator of the Educational CPU Board
* File Name: cpuboard.c
* Descrioption: simulation(emulation) of an instruction
*/
#include "cpuboard.h"
#include <array>
#include <cstddef>
#include <variant>
#include <utility>
#include <iostream>
namespace brainfuck {
enum class error_reason {
MISMATCHING_SQUARE_PARENTHESIS,
use std::marker::PhantomData;
trait Nat { }
struct _0 { }
impl Nat for _0 { }
struct Suc<T: Nat> {
n: PhantomData<T>,
}
#pragma once
#include <algorithm>
#include <initializer_list>
#include <numeric>
#include <memory>
#include <new>
#include <stdexcept>
#include <cstdint>
#include <cstddef>
#include <iostream>
#include <optional>
#include <tuple>
#include <type_traits>
#include <utility>
namespace shouth
{
namespace detail
{
namespace shouth
{
struct Bool { };
struct True : public Bool { };
struct False : public Bool { };
namespace detail
{