Skip to content
Browse files

added a new stereogram. can you find out the hidden message? :-D

  • Loading branch information...
1 parent 82b81a4 commit b346b6be8411e9c248820e761ac01fff61b77b83 @ashbb committed Jul 26, 2009
View
71 README.md
@@ -84,3 +84,74 @@ This is my second shot. After moving some rectangles just a little bit distance,
rects.each{|r| r.toggle}
end
end
+
+
+Sentence Stereogram
+-------------------
+
+**hidden-message.png**
+
+![hidden-message.png](http://github.com/ashbb/shoes_3d_art_stereogram/raw/master/img/hidden-message.png)
+
+**Can you find out the hidden message?** :-D
+
+ # sentence_stereogram.rb
+
+ Shoes.app :width => 520, :height => 350, :title => 'Create hidden message!' do
+ words = IO.read('sentence.txt').split
+ boxes = []
+
+ f = lambda do |x, y|
+ flow :left => x, :top => y, :width => 150, :height => 300 do
+ words.each do |word|
+ word += ' '
+ bk = nil
+ box = flow{bk = background(lightblue).hide; para code(word), :size => 10}
+ boxes << box
+ box.style :width => word.length * 8, :bk => bk
+ box.style :displace_left => 0, :displace_top => 0
+ box.click{box.style[:bk].toggle}
+ end
+ end
+ end
+
+ action = lambda do |n|
+ boxes.each do |box|
+ box.displace(box.style[:displace_left] + n, 0) unless box.style[:bk].style[:hidden]
+ end
+ end
+
+ button('<<'){action[-1]}
+ button('>>'){action[1]}
+
+ nostroke
+ oval 100, 105, 10, :fill => lightblue
+ oval 270, 105, 10, :fill => lightblue
+
+ f[100, 50]
+ f[270, 50]
+ end
+
+**sentence-stereogram.png**
+
+![sentence-stereogram.png](http://github.com/ashbb/shoes_3d_art_stereogram/raw/master/img/sentence-stereogram.png)
+
+You can create your original stereogram (hidden message) with this tiny Shoes app.
+
+- run `sentence_stereogram.rb`
+- click some words and show lightblue
+- click a button `<<` or `>>` some times
+- click again all selected words to hide colors
+
+That's all. You can see your original stereogram.
+
+**Trivial tips**:
+
+- Select right side words and click `>>`. You can see the words down.
+- Select right side words and click `<<`. You can see the words up.
+- Select left side words and click `>>`. You can see the words up.
+- Select left side words and click `<<`. You can see the words down.
+- The number of times changes the depth.
+- You can use original sentence in the `sentence.txt`.
+
+Have fun!
View
BIN img/hidden-message.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN img/sentence-stereogram.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
1 src/sentence.txt
@@ -0,0 +1 @@
+No Ruby or programming experience is required. we would love to find out how easy it is for novices to learn Shoes!
View
36 src/sentence_stereogram.rb
@@ -0,0 +1,36 @@
+# sentence_stereogram.rb
+
+Shoes.app :width => 520, :height => 350, :title => 'Create hidden message!' do
+ words = IO.read('sentence.txt').split
+ boxes = []
+
+ f = lambda do |x, y|
+ flow :left => x, :top => y, :width => 150, :height => 300 do
+ words.each do |word|
+ word += ' '
+ bk = nil
+ box = flow{bk = background(lightblue).hide; para code(word), :size => 10}
+ boxes << box
+ box.style :width => word.length * 8, :bk => bk
+ box.style :displace_left => 0, :displace_top => 0
+ box.click{box.style[:bk].toggle}
+ end
+ end
+ end
+
+ action = lambda do |n|
+ boxes.each do |box|
+ box.displace(box.style[:displace_left] + n, 0) unless box.style[:bk].style[:hidden]
+ end
+ end
+
+ button('<<'){action[-1]}
+ button('>>'){action[1]}
+
+ nostroke
+ oval 100, 105, 10, :fill => lightblue
+ oval 270, 105, 10, :fill => lightblue
+
+ f[100, 50]
+ f[270, 50]
+end

0 comments on commit b346b6b

Please sign in to comment.
Something went wrong with that request. Please try again.