(C) @DanielSWolf 2015
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
Translation to Visual Basic .NET by @vain0 is under the Public Domain.
| ; w = 1 + z + z^2 | |
| #use hspdef | |
| ; origin = (ox, oy), scale = scale | |
| ; x, y, r | |
| #define dot(%1=x,%2=y,%3=2) \ | |
| circle ox + scale*(%1) - (%3), oy + scale*(%2) - (%3), \ | |
| ox + scale*(%1) + (%3), oy + scale*(%2) + (%3) : \ | |
| pos ox + scale*(%1), oy + scale*(%2) |
| module Elmz.Layout where | |
| import List | |
| import Array (Array) | |
| import Either(..) | |
| import Graphics.Element as E | |
| import Graphics.Element (Direction, Element, Position) | |
| type Pt = { x : Int, y: Int } |
| {-# LANGUAGE StrictData, DerivingVia, OverloadedRecordDot #-} | |
| {- | |
| (compiled with GHC 9.4.2) | |
| -} | |
| {- | |
| HEADS UP | |
| this is an example implementation of a non-trivial type system using bidirectional type checking. | |
| it is... |
(C) @DanielSWolf 2015
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
Translation to Visual Basic .NET by @vain0 is under the Public Domain.
| // limit, limitf のテスト | |
| #include "hspmath.as" | |
| #include "hspda.as" | |
| randomize | |
| rndf_ini | |
| assert limit(0x7FFFFFFF, 0, ) == 0x7FFFFFFF | |
| assert limit(0x80000000, , 0) == 0x80000000 |
| パブリックドメイン |
| // 配列の自動拡張の計測 | |
| // @require "benchmark.hsp" <https://gist.github.com/vain0/5aeda019eb11835987f4> | |
| #define global total_size (50000) | |
| #define global cnt_trial (5) | |
| logmes "生成する配列の長さ = " + total_size | |
| logmes "各テストの試行回数 = " + cnt_trial | |
| assert cnt_trial >= 3 |
| // ベンチマーク用モジュール | |
| /* | |
| // デバッグ用コードを除去 | |
| #undef _debug | |
| #undef assert | |
| #define global assert(%1) : | |
| #undef logmes | |
| #define global logmes(%1) : | |
| //*/ |
http://codetter.com/?tag=ue_dai
HSP3の処理系の実装の要点メモ
ランタイムの話はすべて wingui 版のみ。
要加筆: