GithubHelp home page GithubHelp logo

warantesbr / kidsruby Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hybridgroup/kidsruby

0.0 2.0 0.0 10.47 MB

KidsRuby is a Ruby programming environment meant for kids to learn and have fun!

Home Page: http://kidsruby.com

License: Other

kidsruby's Introduction

KidsRuby

KidsRuby (http://kidsruby.com) is a Ruby programming environment meant for kids. If what you want is just to download/install KidsRuby, please go to http://kidsruby.com/download

KidsRuby is heavily influenced by Hackety Hack (http://hackety-hack.com). In fact, you can run many of the same code samples from Hackety Hack in KidsRuby. For example:

color = ask("what is your favorite color")
if color == "blue"
  alert("you picked blue")
end

You can also use the Turtle, just like Hackety-Hack does

Turtle.start do
  background yellow
  pencolor brown
  pensize 2
  goto 30, 200
  setheading 180
  1000.times do
    forward 20
    turnleft rand(10)
    backward 10
  end
end

Design Goals

  • Simple single file editor
  • You can run the current contents of the editor
  • The output appears next to the editor
  • It runs a normal Ruby 1.9.2 on the code. With normal gems etc.

Implementation choices

  • Webkit-based editor - currently using Ace (http://ace.ajax.org/)
  • QtRuby app - hosts webkit and provide http server to communicate with running Ruby environment
  • Minitest/Minispec for testing. Yes, code must be tested
  • Tutorial content is easy to create just drop HTML files on disk locally to the KidsRuby editor.
  • Using a modified version of the JS library Turtlewax for the Turtle implementation https://github.com/davebalmer/turtlewax

How to Run KidsRuby:

ruby main.rb

Getting setup for development on Ubuntu

sudo apt-get install libqt4-dev
sudo apt-get install cmake
bundle install

Take note that the native compilation of qt (the line Installing qtbindings (4.6.3.4) with native extensions) can take several minutes without apparent progress ... You could run top to see cmake and cc1plus effectively in action.

If you also want Gosu

echo "" >> Gemfile
echo "# needed for gosu" >> Gemfile
echo "gem 'gosu'" >> Gemfile
sudo apt-get install g++ libgl1-mesa-dev libpango1.0-dev libboost-dev libopenal-dev libsndfile-dev libxdamage-dev libsdl-ttf2.0-dev libfreeimage3 libfreeimage-dev libxinerama-dev
bundle install

Mac

Mavericks Using homebrew

First things first: Macs are getting weirder. Secondly you will most likely need to install Command Line Tools for XCode. That should solve this install_name_tool: object: Abacate malformed object For instructions go here

You won't be able to use the normal Qt install from homebrew because of some changes with Mavericks. To fix that go here. If you get any problems with cmake then run brew install cmake.

Clone the repo

bundle install

That should be it. Get coding. whip cracks

Mountain Lion using homebrew

This was testing on homebrew commit d02e16c4415e41c7510442a1d58b98077e5e0ae4

You will most likely need to install Command Line Tools for XCode. That should solve this install_name_tool: object: Abacate malformed object For instructions go here

Then run...

brew install qt
for DIR in /usr/local/Cellar/qt/*/lib/*.framework; do ln -s $DIR/Headers ${DIR%%/lib/*}/include/$(basename $DIR .framework); done

Note: the above was done when I was trying the old instructions and I am not sure if this is needed.

Clone the repo

bundle install
NOTES: I had anaconda installed which was using the wrong qmake version make sure anaconda's qmake is not in the path

Getting setup for development on a Mac (pre Mountain Lion)

using Homebrew I used the qtbindings gem: https://github.com/ryanmelt/qtbindings Since I also run homebrew, I discovered that the homebrew install for Qt4 needed a little symlinking before I could run the gem install for qtbindings as described here: https://github.com/ryanmelt/qtbindings/issues#issue/14

However, since KidsRuby requires Qt 4.7, you need to use the following (thanks @clemcke for updated instructions):

cd /usr/local/Library/Formula
git checkout 83f742e /usr/local/Library/Formula/qt.rb
brew install qt
for DIR in /usr/local/Cellar/qt/*/lib/*.framework; do ln -s $DIR/Headers ${DIR%%/lib/*}/include/$(basename $DIR .framework); done
brew install cmake
bundle install

If you have already installed KidsRuby using the OSX installer, you will need to uninstall that Qt package before trying to install the qtbindings gem, or it will not build/install as described here https://github.com/ryanmelt/qtbindings/blob/master/README.txt.

The solution is to run this before attempting to install the qtbindings gem:

sudo /Developer/Tools/uninstall-qt.py

Getting setup on a Mac using Ports

Someone please describe this procedure here.

Getting setup on Windows

Install git standalone
Install Ruby 1.9.2 standalone
bundle install

Credits and Attributions

Light Icon for theme inversion: Creative Commons (Attribution-Share Alike 3.0 Unported)

TODO

TURTLE

  • correct pencolor so it works when switching color while drawing

EDITOR

  • paste into editor (copy already works)

HELP/TUTORIAL

  • update ruby4kids to include their latest lessons
  • add more good stuff!

POSSIBLE IDEAS:

  • make it easy to run pie (see what I did there? And it will only run on macs :P)
  • create Shoes compatible classes (slippers?) to run Shoes example code too

kidsruby's People

Contributors

deadprogram avatar osp123 avatar phlipper avatar bootis avatar dfischer avatar rafmagana avatar hunterboerner avatar silkycove avatar ldenman avatar matsrorbecker avatar danpe91 avatar auser avatar rickard-von-essen avatar mattscilipoti avatar petervandenabeele avatar dmorellet avatar raluxgaza avatar thomaswunderlich avatar codefwd avatar rmcastil avatar ujk avatar blairc avatar kdmsnr avatar

Watchers

James Cloos avatar Willian Arantes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.