Skip to content

Commit 9ec63ab

Browse files
committedNov 15, 2015
Fix file endings
Closes #3
1 parent acd7a27 commit 9ec63ab

6 files changed

+69
-122
lines changed
 

‎brute-forcer.rb

+28-52
Original file line numberDiff line numberDiff line change
@@ -4,58 +4,34 @@
44
require_relative 'grid'
55
require 'stringio'
66

7-
(0..5).each do |in_pos|
8-
(1..5).each do |out_pos|
9-
next if in_pos == out_pos
10-
(1..5).each do |end_pos|
11-
next if end_pos == in_pos || end_pos == out_pos
12-
code = ' '*6
13-
code[in_pos] = ','
14-
code[out_pos] = ';'
15-
code[end_pos] = '@'
16-
17-
$stderr.puts code
18-
19-
(('"'..'~').to_a-['`','?']).repeated_permutation(3) do |a,b,c|
20-
this_code = code.clone
21-
this_code.sub!(' ',a)
22-
this_code.sub!(' ',b)
23-
this_code.sub!(' ',c)
24-
25-
in_stream = StringIO.new('')
26-
out_stream = StringIO.new
27-
errored = false
28-
begin
29-
aborted = Hexagony.run(this_code, 0, in_stream, out_stream, 200)
30-
rescue
31-
next
32-
end
33-
34-
next if aborted || !(out_stream.string.empty?)
35-
36-
in_stream = StringIO.new("\x00\x01\x00\x02")
37-
out_stream = StringIO.new
38-
errored = false
39-
begin
40-
aborted = Hexagony.run(this_code, 0, in_stream, out_stream, 200)
41-
rescue
42-
next
43-
end
44-
45-
next if aborted || !(out_stream.string =~ /^\x00\x01\x00\x02$/)
46-
47-
in_stream = StringIO.new('c0|#')
48-
out_stream = StringIO.new
49-
50-
begin
51-
aborted = Hexagony.run(this_code, 0, in_stream, out_stream, 200)
52-
rescue
53-
next
54-
end
55-
56-
if !aborted && (out_stream.string =~ /^c0\|\#$/)
57-
puts this_code
58-
$stderr.puts this_code
7+
[')', '('].each do |count_char|
8+
(0..5).each do |inc_pos|
9+
([*1..5]-[inc_pos]).each do |out_pos|
10+
([*1..5]-[inc_pos,out_pos]).each do |out2_pos|
11+
code = ' '*6
12+
code[inc_pos] = count_char
13+
code[out_pos] = '!'
14+
code[out2_pos] = ';'
15+
16+
$stderr.puts code
17+
18+
(('"'..'~').to_a-"`?,@".chars).repeated_permutation(3) do |pos|
19+
this_code = code.clone
20+
pos.each do |c| this_code.sub!(' ',c) end
21+
22+
in_stream = StringIO.new('')
23+
out_stream = StringIO.new
24+
errored = false
25+
begin
26+
aborted = Hexagony.run(this_code, 0, in_stream, out_stream, 35)
27+
rescue
28+
next
29+
end
30+
31+
if aborted && (out_stream.string =~ /^1([ \n\t,])2(\1)3/)
32+
puts this_code
33+
$stderr.puts this_code
34+
end
5935
end
6036
end
6137
end

‎examples/fizzbuzz-compact.hxg

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d{$>){*./;\.}<._.zi...><{}.;/;$@-/=.*F;>8M'<$<..'_}....>.3'%<}'>}))'%<..._>_.'<$.....};u..}....{B.;..;.!<'..>z;/

‎examples/fizzbuzz-large.hxg.hex

-31
This file was deleted.

‎examples/fizzbuzz-small.hxg

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
d { $ > ) { *
2+
. / ; \ . } < .
3+
_ . z i . . . > <
4+
{ } . ; / ; $ @ - /
5+
= . * F ; > 8 M ' < $
6+
< . . ' _ } . . . . > .
7+
3 ' % < } ' > } ) ) ' % <
8+
. . . _ > _ . ' < $ . .
9+
. . . } ; u . . } . .
10+
. . { B . ; . . ; .
11+
! < ' . . > z ; /
12+
. . . . . . . .
13+
. . . . . . .

‎examples/fizzbuzz.hxg

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
. . . . . . . . . . . . . .
2+
. . . . . . . . . . . . . . .
3+
. . . . . . . . . . . . . . . .
4+
. . . . . . . . . . . . . . . . .
5+
. . . . . . . . . . . . . . . . . .
6+
. . . . . . . . . . . . . . . . . . .
7+
. . . . . . . . . . . . . . . . . . . .
8+
. . . . . . . . . . > z \ . . . . . . . .
9+
. . . . . . . . . . ; . ; . . . . . . > ; \
10+
. . . . . . . . . . i . ; . . . . . . u . z .
11+
. . . . . . . . . . ; . } . . . . . . ; . ; . .
12+
. . . . . . . . . . F . . . . . . . . B . ; . . .
13+
. . . . . . . . . . ' . | . . . . . . ' . } . . . .
14+
d { $ > ) { * 3 ' % < > $ > } ) ) ' % < . . . . . . .
15+
. . . . . . . . . . _ . . . . . . . . . $ . . . . .
16+
. | . . . . . . / . = { } * < . . . . | . . . . .
17+
. } . . . . . . | . . . . . > ' . . < . . . . .
18+
. > - ; 8 M ' < $ ! = { } < . . . . . . . . .
19+
@ . . . . . . . . . . . . . . . . . . . . .
20+
. . . . . . . . . . . . . . . . . . . . .
21+
. . . . . . . . . . . . . . . . . . . .
22+
. . . . . . . . . . . . . . . . . . .
23+
. . . . . . . . . . . . . . . . . .
24+
. . . . . . . . . . . . . . . . .
25+
. . . . . . . . . . . . . . . .
26+
. . . . . . . . . . . . . . .
27+
. . . . . . . . . . . . . .

‎examples/fizzbuzz.hxg.hex

-39
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.