标题: [游戏娱乐] 塔珀自指公式自定义图形构造器 [打印本页]
作者: aa77dd@163.com 时间: 2016-10-8 00:20 标题: 塔珀自指公式自定义图形构造器
本帖最后由 aa77dd@163.com 于 2016-10-8 10:50 编辑
测试于 64bit Win7 Mathematica 10.0
- ::..........................................................................................................
- ::..........................................................................................................
- ::..........................................................................................................
- ::..........................................................................................................
- ::..........................................................................................................
- ::..........................................................................................................
- ::............#### #### #### #### ### ##### # # ### # # ##### # # ##### #####.............
- ::............# # # # # # # # # # # # # # ## ## # ## # # # .............
- ::............#### #### ### #### ##### # ##### # # # # # ##### # # # ##### # .............
- ::............# # # # # # # # # # # # # # # # # # ## # # .............
- ::............#### #### #### # #### # # # # # ### # # ##### # # # ##### # .............
- ::..........................................................................................................
- ::..........................................................................................................
- ::..........................................................................................................
- ::..........................................................................................................
- ::..........................................................................................................
- ::..........................................................................................................
- :: 上面区域除了左边的两个冒号外, 右边部分保持 106 宽 X 17 高
- :: 不要增加多余的任何空行, 不要删除行, 不要用 # . 空格 之外的字符作图
- :: # 是绘图像素, . 号和 空格 都是空白像素
- ::
- :: BBS.BATHOME.NET
- :: aa77dd@163.com 20161008_001459
- ::
- :: 图像显示调整参数参考
- :: http://math.stackexchange.com/questions/27182/tuppers-self-referential-formula-with-mathematica
- :: 公式表达: 1/2 < floor(mod(floor(y/17)*2^(-17*floor(x)-mod(floor(y), 17)),2))
- :: Tupper's self-referential formula @ wikipedia
- :: https://en.wikipedia.org/wiki/Tupper%27s_self-referential_formula
- ::
- :: 公式自身图形常数值
- :: k=960939379918958884971672962127852754715004339660129306651505519271\
- :: 7028023952664246896428421743507181212671537827706233559932372808741443\
- :: 0789132596394133772348785773574982392662971551717371699516523289053822\
- :: 1612403238855866184013235585136048828693337902491454229288667081096184\
- :: 4960917051834540678277315517054053816273809676025656250169814820834187\
- :: 8316384911559022561000365235137034387446184837873723819822484986346503\
- :: 3159410054974700593138339226497249461751545728366702369745461014655997\
- :: 933798537483143786841806593422227898388722980000748404719;
-
- @echo off & setlocal enabledelayedexpansion
- chcp 936
- mode 110
- for /f usebackq^ delims^= %%a in ("%~f0") do (
- set /a cnt+=1
- if !cnt! leq 17 (
- for %%i in (!cnt!) do (
- set "L%%i=%%a"
- set "L%%i=!L%%i:~2!"
- set "L%%i=!L%%i:#=1!"
- set "L%%i=!L%%i:.= !"
- echo;[!L%%i!]
- )
- )
- )
-
- REM 左下角最最高位, 右上角是最低位
- set "BIN="
- for /L %%c in (0 1 105) do (
- for /L %%r in (17 -1 1) do (
- set "BIN=!BIN!!L%%r:~%%c,1!"
- if "!BIN!"==" " set "BIN="
- )
- )
-
- set "oFile=BBS.BATHOME.NET.Tupper_s_self-referential_formula.nb"
-
- >"!oFile!" (
- echo;k=17*FromDigits["!BIN: =0!",2]; sh = 1;
- echo;tb = Table[
- echo; 1/2 ^< Floor[ Mod[Floor[y/17]*2^^^(-17 Floor[x] - Mod[Floor[y], 17]^), 2]],
- echo; {y, k + 17 - sh, k, -sh}, {x, 106 - sh, 0, -sh}];
- echo;g = Graphics[Raster[tb /. {True -^> 0, False -^> 1}], ImagePadding -^> None, PlotRangePadding -^> None]
- )
-
- call :runNbAtMathematica
- pause
- exit
-
-
- :runNbAtMathematica
-
- for /f "delims== tokens=1*" %%a in ('ftype ^| findstr /i /r "\.nb.*Mathematica.exe"') do (
- set "MathematicaPath=%%~dpnb.exe"
- echo;找到 Mathematica 路径 !MathematicaPath! 启动 Mathematica ...
- start "" "!MathematicaPath!" "%~dp0!oFile!"
- exit /b
- )
- if not defined MathematicaPath echo;未安装 Mathematica
- exit /b
复制代码
作者: happy886rr 时间: 2016-10-8 08:28
很有数学艺术感
作者: codegay 时间: 2016-10-8 08:32
没图没JB
欢迎光临 批处理之家 (http://bathome.net./) |
Powered by Discuz! 7.2 |