noofakku 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +13 -5
  2. data/lib/noofakku.rb +25 -3
  3. metadata +5 -5
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: a17e8b9cc40d562cf8430b8fc65bc3ad73a034c5
4
- data.tar.gz: 45fd3f577476b0414e415cf52a22accbd9a4a8fc
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NjY3NzRkNDgzZGMzODRhODhmMjc3N2FmNTQ2NTY2Zjk2OWU1NzZhMQ==
5
+ data.tar.gz: !binary |-
6
+ YjRhMTU1ZjJkNmVmN2IyNzE1MWZlODEyMWQxOWVmOGMwNmExZWFhMQ==
5
7
  SHA512:
6
- metadata.gz: 92190e61ac7215c0d01cd1cb488b557be590f9dda77d188781f4a406398ff19f0252595d90c20ccad4f4aeff4685e2c73089f58d96fe900adcd6f428c175e2a9
7
- data.tar.gz: 3f094035a6d45b522e32223bff44ee80f5646ee40e29dd705b57ada9e716c6ac33690cabec2fa09834fa29004777b2c27c5cb5d36d1266a290bacdb4b5514de6
8
+ metadata.gz: !binary |-
9
+ YWIxZjA3OGY0OTI4MGFkZDU3YmYxZWQyOWFmMTMyODQzZjg5M2EwYTU5MGNm
10
+ YjViODJlZWVjNGIzNTg0ODRkYzBiYTJjY2VjMjA2OWIwYWU1ODlhMzczNTdi
11
+ YWJmNDIxZTM4N2ZiZjhhNWJkNWQ5ZmE0YzU2ZjIwY2MyMzE5NmQ=
12
+ data.tar.gz: !binary |-
13
+ YzIyMWEwMTI4ZDY0NzMyNTYwMDBlYmE2YzM4NzM4NjY4YjAzMWVlM2MyZWRj
14
+ ZjZiMzU3MGFkYzJjYjllZWExZGRmNDQ3MGE3NjRjMmIyN2YwZDNhYWE2OTE4
15
+ ZTRiYTQ5MjBmZWM1ZTJhODFmZTA3MTBiMjQ1ZTZkYWVhNWQ1MDM=
data/lib/noofakku.rb CHANGED
@@ -1,5 +1,27 @@
1
- class Noofakku
2
- def hi
3
- puts "Hello world!"
1
+ require 'noofakku/instruction/open_bracket'
2
+ require 'noofakku/instruction/closed_bracket'
3
+ require 'noofakku/instruction/inc'
4
+ require 'noofakku/instruction/dec'
5
+ require 'noofakku/instruction/prev'
6
+ require 'noofakku/instruction/next'
7
+ require 'noofakku/instruction/input'
8
+ require 'noofakku/instruction/output'
9
+ require 'noofakku/processor'
10
+
11
+ module Noofakku
12
+ class VM
13
+ def self.start(program, input, output)
14
+ processor = Processor.new(Hash.new(Noop.new).merge!({
15
+ ">" => Next.new,
16
+ "<" => Prev.new,
17
+ "+" => Inc.new,
18
+ "-" => Dec.new,
19
+ "." => Output.new,
20
+ "," => Input.new,
21
+ "[" => OpenBracket.new("[", "]"),
22
+ "]" => ClosedBracket.new("[", "]")
23
+ }))
24
+ processor.run(program.clone.freeze, Array.new(30_000, 0), input, output)
25
+ end
4
26
  end
5
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noofakku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mauro Codella
@@ -27,18 +27,18 @@ require_paths:
27
27
  - lib
28
28
  required_ruby_version: !ruby/object:Gem::Requirement
29
29
  requirements:
30
- - - '>='
30
+ - - ! '>='
31
31
  - !ruby/object:Gem::Version
32
32
  version: '0'
33
33
  required_rubygems_version: !ruby/object:Gem::Requirement
34
34
  requirements:
35
- - - '>='
35
+ - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
37
  version: '0'
38
38
  requirements: []
39
39
  rubyforge_project:
40
- rubygems_version: 2.0.3
40
+ rubygems_version: 2.1.11
41
41
  signing_key:
42
42
  specification_version: 4
43
- summary: ''
43
+ summary: Noofakku
44
44
  test_files: []