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 nextLCG(seed) | |
| seed = seed * 0x5D588B656C078965 + 0x269EC3 | |
| seed = seed % 0x10000000000000000 | |
| return seed | |
| end | |
| def prevLCG(seed) | |
| seed = seed *0xDEDCEDAE9638806D+0x9B1AE6E9A384E6F9 | |
| seed = seed % 0x10000000000000000 | |
| return seed |
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
| private void modDefensePower() { | |
| int mod = 0x1000; | |
| if(field.isBenefitSandstorm) { | |
| defensePower = calcRoundHalfDown(defensePower * 3 / 2); | |
| } | |
| //しんかいの鱗 メタルパウダー 心の雫 | |
| switch (defenseAbility) { | |
| case MARVEL_SCALE: |
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
| template <typename T> | |
| void exEuclidAlgo2(T a,T b,T& x,T &y) { | |
| T x0,y0,u0,v0; | |
| T x1,y1,u1,v1; | |
| T r0,r1,r2; | |
| T k; | |
| r0 = a; | |
| r1 = b; | |
| k = r0 / r1; |
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 <iostream> | |
| #include <cstdint> | |
| #include <cstdio> | |
| class MT { | |
| uint32_t mt_table[624]; | |
| uint32_t mt_count; | |
| public: | |
| MT(uint32_t s){ | |
| mt_table[0] = s; | |
| for(int i=1; i<624; i++) { |
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
| # -*- coding: utf-8 -*- | |
| require "net/http" | |
| require "uri" | |
| require "json" | |
| require "nokogiri" | |
| require "open-uri" | |
| #メガ進化はまだ | |
| def to_ja(name) |
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
| # -*- coding: utf-8 -*- | |
| require 'nokogiri' | |
| require 'open-uri' | |
| def hoge(index) | |
| uri = "http://www.serebii.net/pokedex-xy/#{index}.shtml" | |
| doc = Nokogiri::HTML(open(uri)) | |
| data = doc.xpath('//*/text()[contains(.,"Base Stats")]/../../td/text()').to_a |
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
| # -*- coding: utf-8 -*- | |
| require "nokogiri" | |
| require "open-uri" | |
| require "sqlite3" | |
| def get_base_stats(doc) | |
| base_stats = Array.new | |
| data = doc.xpath("//*/text()[contains(.,'Base Stats')]/../..") |
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 <iostream> | |
| #include <thread> | |
| #include <mutex> | |
| #include <vector> | |
| #include <cstdint> | |
| #include <cstdlib> | |
| std::mutex print_mutex; | |
| template <class T> | |
| void print_hex(T x) { |
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 <iostream> | |
| template<bool Cond> | |
| struct bool_; | |
| template<> | |
| struct bool_<true> { | |
| static const bool value = true; | |
| }; | |
| template<> | |
| struct bool_<false> { | |
| static const bool value = false; |
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
| require "dxruby" | |
| load "object.rb" | |
| Window.width=800 | |
| Window.height=600 | |
| font = Font.new(32) | |
| win = false | |
| lose = false | |
| def distance(obj1,obj2) | |
| Math.sqrt((obj1.x-obj2.x)**2 + (obj1.y-obj2.y)**2 ) |
OlderNewer