Twitterの2次関数の問題
https://twitter.com/ikeikey/status/1538698742718681089
$$ a, b, c \in \{1, 2, 3, 4, 5, 6, 7, 8, 9\}
Twitterの2次関数の問題
https://twitter.com/ikeikey/status/1538698742718681089
$$ a, b, c \in \{1, 2, 3, 4, 5, 6, 7, 8, 9\}
| map_key: map_key.cpp | |
| $(CXX) -o $@ -std=gnu++17 -Wall -Wpedantic -g $^ |
| orcs: orcs.c | |
| $(CC) -std=gnu11 -o $@ $^ |
| # frozen_string_literal: true | |
| # https://twitter.com/MomiRaccoon/status/1434402973627531267 | |
| # | |
| # 女騎士「わ、私に性感度3000倍もさせて一体何をさせるんだ…」 | |
| # オーク「ククク…」 | |
| # | |
| # オークA「感度を半分にするクスリだ」 | |
| # オークB「感度を900マイナスにするクスリだ」 | |
| # オークC「感度を2000プラスにするクスリだ」 |
BCDice development team accepts translations from Japanese into other languages. This document explains how to submit a translation.
Please contact us on the Discord server "bcdice-help" if the directory for the game system that you are going to translate does not exist in i18n/.
There is some work to be done before we accept your translation.
| Table Create Table | |
| contents CREATE TABLE `contents` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `text` text,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC | |
| Table Create Table | |
| c_refs CREATE TABLE `c_refs` (\n `id` int(11) NOT NULL AUTO_INCREMENT,\n `content_id` int(11) DEFAULT NULL,\n PRIMARY KEY (`id`),\n KEY `index_c_refs_on_content_id` (`content_id`),\n CONSTRAINT `content_id` FOREIGN KEY (`content_id`) REFERENCES `contents` (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC |
| class BCDice::CommonCommand::Parser | |
| token | |
| ASTERISK | |
| AT | |
| BRACKETL | |
| BRACKETR | |
| C | |
| CMP_OP | |
| D |
Joel S. Cohen: "Computer Algebra and Symbolic Computation: Mathematical Methods", A K Peters (2003)を参考にして、抽象構文木の変形による数式の代数的簡約化(algebraic simplification)を実装した。現在は、加算、減算、乗算、および符号反転(単項マイナス)のみに対応している。また、BCDiceでの需要に合わせて、加算部分は間の項をまたいで簡約化されないように文献からアルゴリズムを変えている。
実行にはparslet gemが必要。
require_relative 'parser'
require_relative 'simplification'| .ipynb_checkpoints |
| require 'yaml' | |
| require 'json' | |
| lines = ARGF.readlines(chomp: true) | |
| json_lines = lines.map { |line| | |
| left_bracket_index = line.index('[') | |
| line[left_bracket_index..-1] | |
| } | |
| hashes = json_lines.map { |line| | |
| JSON.parse(line) |