brainf-ckme
所属分类:人工智能/神经网络/深度学习
开发工具:CoffeeScript
文件大小:0KB
下载次数:0
上传日期:2014-09-21 07:59:15
上 传 者:
sh-1993
说明: 写他***的Brainfuck代码,在他***的Node或浏览器上运行,
(Write the fucking Brainfuck code and run the fuck on fucking Node or fucking browser,)
文件列表:
.travis.yml (36, 2014-09-21)
LICENSE (1081, 2014-09-21)
Makefile (406, 2014-09-21)
lib/ (0, 2014-09-21)
lib/brainfuckme.coffee (2466, 2014-09-21)
lib/brainfuckme.js (4937, 2014-09-21)
mocha (112, 2014-09-21)
package.json (653, 2014-09-21)
test/ (0, 2014-09-21)
test/module_spec.coffee (7004, 2014-09-21)
test/module_spec.js (9885, 2014-09-21)
Brainfuckme (brainf-ckme)
===========
[![Build Status][travis-img]][travis-url]
[![Coverage Status][coveralls-img]][coveralls-url]
[![NPM Download][npm-img]][npm-url]
[travis-img]: http://img.shields.io/travis/drabiter/brainf-ckme.svg?style=flat-square
[travis-url]: https://travis-ci.org/drabiter/brainf-ckme
[coveralls-img]: http://img.shields.io/coveralls/drabiter/brainf-ckme.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/drabiter/brainf-ckme?branch=master
[npm-img]: http://img.shields.io/npm/v/npm.svg?style=flat-square
[npm-url]: https://www.npmjs.org/package/brainfuckme
[![NPM](https://nodei.co/npm/brainfuckme.png?downloads=true)](https://nodei.co/npm/brainfuckme/)
Write the f*cking Brainf*ck code and run the f-ck.
[Demo page](http://drabiter.com/brainf-ckme).
## Installation
Brainfuckme supports client and server usage.
For client (browser), use simply grab `lib/brainfuckme.js` and add ``
For server (node), use npm command `npm install brainfuckme`
## Usage
#### Client
```javascript
var bfkme = new Brainfuckme();
bfkme.run(
',[.,]', // source code string
[97, 98, 99], // input data
function(output){ // callback
console.log(output); // `output` is [97, 98, 99]
}
);
```
#### Server
```javascript
var Brainfuckme = require('brainfuckme');
var bfme = new Brainfuckme();
bfme.run()
```
## API
`.run(code, input, callback)`
- `code` String which can contains +-,.<>[] code and comments
- `input` Array of integers. Used as input (duh!)
- `callback` A function that take two args, the array of integers and its String representation.
`.resume(code, input, callback)` - same as `.run()`.
`inputToArray(string)` - converts *string* into array of integers.
`.outputToString()` - returns the output stack as String. `[110, 121, 97, 110, 99, 97, 116]` will return *nyancat*.
`.value()` - return value of current pointed cell.
`.reset()` - reset the object's state (cursor, output stack, input stack, pointer).
## Changelog
**0.2.1**
- Now available in two flavors, coffee and vanilla
- Various fixes
近期下载者:
相关文件:
收藏者: