noofakku 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/lib/noofakku.rb +25 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NjY3NzRkNDgzZGMzODRhODhmMjc3N2FmNTQ2NTY2Zjk2OWU1NzZhMQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YjRhMTU1ZjJkNmVmN2IyNzE1MWZlODEyMWQxOWVmOGMwNmExZWFhMQ==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
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
|
-
|
2
|
-
|
3
|
-
|
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.
|
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.
|
40
|
+
rubygems_version: 2.1.11
|
41
41
|
signing_key:
|
42
42
|
specification_version: 4
|
43
|
-
summary:
|
43
|
+
summary: Noofakku
|
44
44
|
test_files: []
|