1 Star 0 Fork 0

dingusxp/code1024

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

code1024

介绍

code1024 是一个有意思的 编程画图 游戏,起源是这个:

http://codegolf.stackexchange.com/questions/35569/tweetable-mathematical-art

这里稍微做了一下扩展,放松了代码量限制和更多编程语言的支持。

规则:

目标:

通过实现 模版(见 /tpl 目录) 中的一个函数 get_color_at(x, y) ,在一个 1024x1024 的画布上画出尽可能 “有意思” 的图案。

参数:

int x, int y ,取值均为 0 - 1023,对应画布上坐标点,左上角为起始点 (0,0)

返回:

int r, int g, int b, int alpha, 对应颜色的 RGBA 分量,均为 0 - 255。

注意:各语言中 alpha 分量定义可能不同,由 模版 统一转换为: 0 - 255,值越大越透明。

要求:

只能编辑 模版 中 get_color_at(x, y) 函数体内 // {{code start}} - // {{code end}} 间的代码;

代码总字符数不能超过 1024 个;

模版规范:

命名:

暂时只允许单文件,放置在 /tpl/ 目录下;

名称格式 “[语言]-[绘图方式]”,后缀视语言定。 如 PHP-gd.php, JS-canvas.html

功能:

提供 get_color_at(x, y) 函数,预留区域 // {{code start}} - // {{code end}} ;

调用 get_color_at(x, y) 函数,获取每一个像素点的 RGBA 颜色,在一个 1024*1024 的画布上画出图案。

绘图代码提交和展示:

https://dingusxp.com/app/draw1024/list

The MIT License (MIT) Copyright (c) {{{year}}} {{{fullname}}} Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

一个有意思的 编程画图 游戏 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者 (2)

全部

近期动态

5年多前创建了仓库
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/dingusxp/code1024.git
git@gitee.com:dingusxp/code1024.git
dingusxp
code1024
code1024
master

搜索帮助