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 Sub NewBoard(x As Integer, y As Integer) | |
| Dim v As ULong = values(x, y) | |
| Dim dxs As Integer() = {1, 1, 0, -1, -1, -1, 0, 1} | |
| Dim dys As Integer() = {0, 1, 1, 1, 0, -1, -1, -1} | |
| For direction As Integer = 0 To 7 | |
| Dim dx = dxs(direction), dy = dys(direction) | |
| Dim cx As Integer, cy As Integer | |
| cx = x + dx | |
| cy = y + dy | |
| Dim first As Boolean |
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
| extern (C) ulong* f(size_t l, ulong* x, ref size_t rl) | |
| { | |
| ulong[] ret; | |
| /* 実際の処理が入る */ | |
| rl = ret.length; | |
| return &ret[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
| extern(C) | |
| void f( | |
| size_t l, ulong* x, // 引数のサイズと先頭 | |
| ref size_t rl, ulong* ret // 返り値の最大サイズと先頭 | |
| ) | |
| { | |
| /* rl を実際の返り値のサイズに、ret の中身を返り値に書き換える。 | |
| * rl が受け取った時より大きくなる場合は例外でも投げる? | |
| */ | |
| return; |
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
| size_t msb(ulong x) | |
| { | |
| assert (x); | |
| size_t ret = 0; | |
| auto i = 1 << (6 - 1); | |
| while (i) | |
| { | |
| if (x >> i) | |
| { | |
| ret |= 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
| // いろいろ残念な感じ | |
| import std.datetime : StopWatch, TickDuration; | |
| struct Performance(T) | |
| { | |
| size_t executions; | |
| double second; | |
| T result; | |
| this (TickDuration td, size_t executions, T result) |
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
| OPTLINK (R) for Win32 Release 8.00.12 | |
| Copyright (C) Digital Mars 1989-2010 All rights reserved. | |
| http://www.digitalmars.com/ctg/optlink.html | |
| main.obj(main) | |
| Error 42: Symbol Undefined _D4core6memory2GC6extendFPvkkZk | |
| main.obj(main) | |
| Error 42: Symbol Undefined _D4core6memory2GC6qallocFkkZS4core6memory8BlkInfo_ | |
| main.obj(main) | |
| Error 42: Symbol Undefined _D4core5bitop3bsrFNaNbkZi | |
| --- errorlevel 3 |
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
| mixin template FF(F) | |
| { | |
| ... | |
| } | |
| struct F | |
| { | |
| mixin FF!(F); | |
| } |
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
| mixin template FF(F) | |
| { | |
| struct F | |
| { | |
| ... | |
| } | |
| } | |
| mixin FF!(F); // ERROR: F does not exist. |
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
| from random import shuffle | |
| C = 12 # number of cards | |
| class Player: | |
| def __init__(self, cards, dealer, awake, id): | |
| self.hand = cards | |
| self.dealer = dealer |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Collections; | |
| namespace app | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { |