Inspired by Marcus Kazmierczak's 10 Scala One Liners to Impress Your Friends.
Range[10] * 2
+++++ | |
++++-+><++++-+++<>-+><<>-++++><<>++-+++++ | |
++++++-++-+++++<>+++++++++-++<>+++++++++->< +++ | |
+++++><><+++-+-+<><>++++-+++- ++.>+<<> <+-<<<<<+- | |
+><<<>> <>>>>+-> <>-+>>>+-+ | |
++><+++ ++>-+>> >>>[>++ +>-+-<>++- | |
<+-><++- ++<-]<< ><<<>+- <<<+++-><+- | |
++++++++ ><++++++ ++++++-+++<>- ++<>++-+-+-+ <>-+++ | |
+><+++++++-++->>>>>><<>>[>+>++><---<+->< +-+-<-><]+-<+-<<<><<<><++<>><+++++<<<<><-+-+-+ | |
<<<<<+++->>>>>>>>>+++><+++++<>+-+++>>>> >>[>+>+---+<>-++<<-]><<<<<<<++++-<-+>++++++ |
ToExpression[ | |
"input=StringToStream[\"" <> ##2 <> | |
"\"];Clear[memory];memory[_]=pointer=0;" <> | |
StringReplace[#, | |
{">" -> "pointer++;", | |
"<" -> "pointer--;", | |
"+" -> "memory[pointer]++;", | |
"-" -> "memory[pointer]--;", | |
"." -> "BinaryWrite[OutputStream[\"stdout\",1],memory[pointer]];", | |
"," -> "memory[pointer]=BinaryRead[input];", |
MazeGraphics[m_, n_] := | |
Block[{$RecursionLimit = Infinity, | |
unvisited = Tuples[Range /@ {m, n}], maze}, | |
maze = Graphics[{Line[{{#, # - {0, 1}}, {#, # - {1, 0}}}] & /@ | |
unvisited, | |
Line[{{0, n}, {0, 0}, {m, 0}}]}]; {unvisited = | |
DeleteCases[unvisited, #]; | |
Do[If[MemberQ[unvisited, neighbor], | |
maze = DeleteCases[ | |
maze, {#, |
Module[{a, s, d, f}, RemoveScheduledTask@ScheduledTasks[]; | |
a[] := s = | |
If[#[[1]] == f, | |
f = RandomChoice[Complement[Tuples[Range /@ {34, 55}], #]]; #, | |
Most@#] &@PrependTo[s, s[[1]] + d]; s = {{17, 28}}; | |
f = {18, 28}; d = {1, 0}; | |
RunScheduledTask[ | |
If[1 <= #[[1]] <= 34 && 1 <= #[[2]] <= 55 && FreeQ[Most@s, #] &[ | |
s[[1]] + d], a[], | |
s = Position[ |
DynamicModule[{board, winner, p, pmouse, ppossible, v, Reset}, | |
Reset[] := {winner, board} = {"", ConstantArray[0, {20, 20}]}; | |
Reset[]; Deploy@ | |
Graphics[Button[{Brown, Rectangle[{0, 0}, {20, 20}], Black, | |
Line[Join @@ | |
Table[{{{i, 0}, {i, 20}}, {{0, i}, {20, i}}}, {i, .5, 19.5}]], | |
Dynamic[pmouse = | |
Ceiling@MousePosition["Graphics", {-1, -1}] /. {0 -> 1, | |
21 -> 20}; | |
If[1 <= Min@pmouse <= Max@pmouse <= 20 && |
(*_*) | |
挪[左] = # //. {{x___, 1, a_ /; a > 1, y___} :> {x, a, 1, y}, | |
{x___, a_ /; a > 1, a_, y___} :> {x, 2 抓住[a], 1, y}} /. | |
抓住[a_] :> a &; | |
挪[上] = Composition[Transpose, 挪[左], Transpose]; | |
挪[下] = Composition[Reverse, 挪[上], Reverse]; | |
挪[右] = Composition[Transpose, 挪[下], Transpose]; | |
加块瓦 = ReplacePart[#, RandomChoice@Position[#, 1] -> 2] &; |
# Rime dictionary | |
# encoding: utf-8 | |
--- | |
name: greek | |
version: "0.1" | |
sort: original | |
... | |
# 小写希腊字母 |
# Rime schema | |
# vim: set sw=2 sts=2 et: | |
# encoding: utf-8 | |
schema: | |
schema_id: palladius | |
name: "西里尔拼音" | |
version: "0.0" | |
author: | |
- AlephAlpha <[email protected]> |
Inspired by Marcus Kazmierczak's 10 Scala One Liners to Impress Your Friends.
Range[10] * 2
# Rime schema | |
# vim: set sw=2 sts=2 et: | |
# encoding: utf-8 | |
schema: | |
schema_id: jcuken | |
name: ЙЦУКЕН | |
version: "1.0" | |
author: | |
- AlephAlpha <[email protected]> |