All Projects → muzea-demo → random-data

muzea-demo / random-data

Licence: MIT license
随机数据产生姬

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to random-data

Online-Judge
Online Judge for testing programming ability in C, C++, Java and Python.
Stars: ✭ 25 (+19.05%)
Mutual labels:  online-judge
random-restaurant-generator
An Android app that queries Yelp's API for a random restaurant near you
Stars: ✭ 15 (-28.57%)
Mutual labels:  random
recruitr
Online Code Judging Tool
Stars: ✭ 25 (+19.05%)
Mutual labels:  online-judge
Random-Mouse-Clicker
Randomly auto-clicks inside of a drawn region
Stars: ✭ 19 (-9.52%)
Mutual labels:  random
fastfaker
Fast, concurrent fake data generator for any structure or type.
Stars: ✭ 21 (+0%)
Mutual labels:  random
CounterView
一个数字变化效果的计数器视图控件
Stars: ✭ 38 (+80.95%)
Mutual labels:  random
hustoj
Popular Open Source Online Judge based on PHP/C++/MySQL/Linux for ACM/ICPC and NOIP training, with easy installation. 开源OJ系统
Stars: ✭ 2,773 (+13104.76%)
Mutual labels:  online-judge
template-string-optimize-loader
template string optimize loader module for webpack
Stars: ✭ 15 (-28.57%)
Mutual labels:  template-string
ruuid
A fast uuid generator in Python using Rust
Stars: ✭ 19 (-9.52%)
Mutual labels:  random
online-judgement
A collaborative online code judge system
Stars: ✭ 33 (+57.14%)
Mutual labels:  online-judge
random
Random data generator AKA faker
Stars: ✭ 14 (-33.33%)
Mutual labels:  random
RNG
A simple state-of-the-art C++ random number generator
Stars: ✭ 19 (-9.52%)
Mutual labels:  random
colorsys
🎨 Minimalistic color converter for RGB, HSV, HSL, CMYK, HEX and CSS strings
Stars: ✭ 53 (+152.38%)
Mutual labels:  random
leetcode
😖 😕 😃LeetCode问题解题思路。
Stars: ✭ 132 (+528.57%)
Mutual labels:  online-judge
color
A library of well-tested helper methods for working with colors.
Stars: ✭ 13 (-38.1%)
Mutual labels:  random
gdoj
The Online Judge Web Platform For ACM
Stars: ✭ 30 (+42.86%)
Mutual labels:  online-judge
random
The most random module on npm
Stars: ✭ 106 (+404.76%)
Mutual labels:  random
html-template-tag
📄 - ES6 Tagged Template for compiling HTML template strings
Stars: ✭ 45 (+114.29%)
Mutual labels:  template-string
cp-tool
cp-tool is an auto generator for solved problems at different online judges.
Stars: ✭ 24 (+14.29%)
Mutual labels:  online-judge
judge
A blazingly fast online judge/ autograder ⚖️ built with Python and the Django framework to test cases against your solution. Check out the sponsor links and help fund DomeCode.
Stars: ✭ 30 (+42.86%)
Mutual labels:  online-judge

随机数据产生姬

这是一个字符串拼接工具,可以用于OJ的测试数据生成, 点我在线体验

cli 工具用法见 cli使用指北

语法

现在只支持两种语句

constraint 约束 限制变量取值

repeat 重复 会输出内容

重要 每一个变量都需要有约束

constraint 的语法

int类型

constraint 变量名 int 最小值 最大值

比如

constraint n int 1 233

变量名 最好都是字母(汉字也行)

最小值和最大值可以是别的变量名

区间是左闭右开

set类型

constraint 变量名 set value1 value2 value3

比如

constraint 数字 set 一 二 三 四

value之间使用空格分隔

repeat 的语法

line类型

repeat 重复次数 重复的内容

重复次数 可以是一个数字,也可以是一个变量

从紧跟 重复次数 的空格后面开始,到这一行结束都会被视为一个模板,我们使用 ${变量名} 来引用一个变量

比如

repeat 1 ${n}

亦或者

repeat 1 prefix string ${n}

都是被允许的

group类型

repeat group 重复次数
repeat line
repeat line
repeat line
end group

重复次数 可以是一个数字,也可以是一个变量

案例

普通案例

举个例子,假如我们的数据是

第一行输入一个n,代表接下来有n行数据,每行数据有三个数a b c

那么就是

repeat 1 ${n}
repeat n ${a} ${b} ${c}

然后补充一下约束就好了

再举一个例子

假如我们的数据是这个样子的

第一行是n,代表接下来有n组数据

每组数据的第一行有三个数row min max,代表接下来有row个数字,每个数字的取值是 [min, max)

那我们可以这样写

constraint n int 5 10
constraint row int 10 20
constraint min int 150 200
constraint max int 500 1000
constraint num int min max
repeat 1 ${n}
repeat group n
repeat 1 ${row} ${min} ${max}
repeat row ${num}
end group

来一个set的例子

constraint 姓 set 赵 钱 孙 李
constraint 名 set 一 二 三 四
repeat 10 ${姓}${名}

当然,本质是个字符串拼接,也可以写别的东西

sql测试数据

constraint 姓 set 赵 钱 孙 李
constraint 名 set 一 二 三 四
constraint value int 10 1000
constraint status int 0 2
repeat 10 INSERT INTO list (name, value, status) VALUES ("${姓}${名}", ${value}, ${status});

程序没有检查输入是否合法,所以需要你自己注意一下 :)

高级用法

图、flags 这些的使用,参见 高级用法

更新日志

参见 更新日志

更新计划

不存在的

其他

这个轮子的目的是设计一个足够简单的工具来生成数据,这也就意味着她不能支持所有的场景,也不能对数据做高度定制。

如果有这种需求的话,应该自己写代码,或者使用类似 CYaRon 的工具。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].