Tag: Programming

Using Scratch with Minecraft & Scriptcraft – step by step instructions

As described in my previous posts, I found  Scriptcraft, the Minecraft plugin created by Walter Higgins, to be a very powerful tool for Minecraft modding and also for learning Javascript. I use it myself to learn and also for teaching kids to code as they can see immediately the result of the issued commands. One of the features I love is that it implements a drone, described as “an (invisible) object you create every time you execute any of the building or movement functions”, that is very similar to the turtle from other languages.

While kids aged 10 or more can understand how it works and can learn how to create their own functions, younger ones can be overwhelmed by the syntax rules and the need to create the files or to link additional modules.

I’m teaching coding to some 8 years old kids who are pretty good with Scratch and love playing Minecraft so I searched for a solution to make these apps work together. The first configuration, described in Using Scratch & Scriptcraft (& more) to teach kids programming in Minecraft was very complex, using Scratch offline with experimental extensions, Node RED, mosquitto mqtt broker and Spigot Minecraft server with Scriptcraft with mqtt plugin. It was based  on Dave Locke’s idea for sending commands from Scratch as MQTT messages, presented in  Visual programming and integration with Scratch, Node-Red and MQTT.

Recently I found a simple solution to receive http commands and to pass them to Minecraft server, based on Node.js,  presented by Kevin Whinnery   in Child Processes, Streams, and Minecraft Server Management via Text Message using Node.js. This configuration only needs Node.js to link Scratch with Minecraft, where the commands are interpreted and executed by Scriptcraft.

I will try to present here more in detail all what is needed (you can skip any of the sections below if you already installed the related application):

On the server side:

Spigot MC server

You have to download BuildTools.jar from https://hub.spigotmc.org/jenkins/job/BuildTools/ and the to follow the instructions from https://www.spigotmc.org/wiki/buildtools/. Basically you have to run this command (not to double click on the downloaded file)

java -jar BuildTools.jar

and after a while you will find in the same folder craftbukkit-1.xx.jar and spigot-1.xx.jar. When writing this, latest version is 1.10, so I used the file spigot-1.10.jar.

The next steps are described at https://www.spigotmc.org/wiki/spigot-installation/. Follow them and make sure the server works.

Scriptcraft

Download scriptcraft.jar from http://scriptcraftjs.org/download/latest/ and copy it in the Minecraft server \plugins subfolder.
Restart the server and you will see something similiar to this in the output console:
[14:04:25 INFO]: [scriptcraft] Enabling scriptcraft v3.2.0-2016-03-19

Scriptcraft will create its own folder structure under the Minecraft server main folder.

Node.js

Download the pre-built installer for your OS from https://nodejs.org/en/download/, launch it and follow the on-screen instructions.

On the client side

Scratch 2.0 offline

Download it from https://scratch.mit.edu/scratch2download/  (start by installing Adobe Air if it isn’t already installed on your computer)

Minecraft client

Install the PC/Mac version from https://minecraft.net/en/download/. You must have a paid account in order to use it.

Making it all work together

Update: you can find the most recent version of the files below (mc.js, scratch.js and MCextension.json) at https://github.com/mpatrascu/ScratchMC/

Following the installation instructions for MC server you should have created a script or a batch file (depending on the OS) containing a line similar to this (I didn’t use the other parameters):

java -Xms512M -Xmx1G -jar spigot.jar

Instead of using this script to launch the server, you must create a mc.js file in the same folder, where you copy the following text (taking care to keep your previous parameters for spawning the new java process):

 

// Require Node.js standard library function to spawn a child process
var spawn = require('child_process').spawn;

// Create a child process for the Minecraft server using the same java process
// invocation we used manually before
var minecraftServerProcess = spawn('java', [
    '-Xmx1G',
    '-Xms512M',
    '-jar',
    'spigot.jar'] );

// Listen for events coming from the minecraft server process - in this case,
// just log out messages coming from the server
function log(data) {
    process.stdout.write(data.toString());
}
minecraftServerProcess.stdout.on('data', log);
minecraftServerProcess.stderr.on('data', log);


var http = require("http");

scratchResponse=[];  //stores the IP and current block values in MC for each Scratch client: 

http.createServer(function(request, response) { //communicates with Scratch extension on port 8088
var ip = request.connection.remoteAddress.slice(7);

if (request.url!="/poll"){ //commands from Scratch - URL format is /command/first_param/second_param/../last_param/
    
    var command=request.url.toString().slice(1);
    minecraftServerProcess.stdin.write('js scratch("' + command + '","' + ip + '")' + '\n');
    response.end();
    
    if (request.url=="/reset_all"){ //end of Scratch session        
        position=-1;
        for(i=0;i<scratchResponse.length; i++){             if (scratchResponse[i].ip==ip){                 position=i;                                 }             }         if (position>-1) scratchResponse.splice(position,1);
        console.log('Scratch client on IP: ' + ip + ' disconnected. Remaining ' + scratchResponse.length + ' connections.');
        }    
  }
else{ //polling by Scratch
    bltype = -1;
    bldata = -1;
    result = -1;
    
    for(i=0;i<scratchResponse.length; i++){
        if (scratchResponse[i].ip==ip){
            bltype=scratchResponse[i].bltype;
            bldata=scratchResponse[i].bldata;
            result=scratchResponse[i].result;
        }
    }

    response.write("blockType " + bltype + "\nblockData "+bldata + "\nresult " + result);
    response.end();

    }
}).listen(8088);

http.createServer(function(request, response) {  //receives updates from Minecraft server on port 8089 - URL format is /blockType/blockData/IP/
params=request.url.toString().slice(1).split("/");
console.log("update information received: " + request.url.toString().slice(1));
ip=params[3];

found=0;
for (i=0; i < scratchResponse.length;i++){
    if(scratchResponse[i].ip==ip){
        scratchResponse[i].bltype=params[0];
        scratchResponse[i].bldata=params[1];
        scratchResponse[i].result=params[2];
        found=1;
    }
}
if (!found)
    scratchResponse.push({bltype:params[0], bldata: params[1], result: params[2], ip:params[3]});

response.write('ip'+(found?' found':' added to list'));
response.end();

}).listen(8089);
You invoke this file by typing
>node mc.js
It will launch Minecraft server as a child process and will listen to ports 8088 and 8089. On port 8088 it receives commands and poll requests from Scratch and on port 8089 it receives information from MC server – current block values and result of some operations. You can leave the ports unchanged, or you can choose other values, but you will need to also update the following two files.
In the Scriptcraft plugins folder you have to copy the file scratch.js which interprets commands passed by the Node.js script.
var Drone = require('/drone/drone').Drone
var foreach = require('utils').foreach

var JavaString = java.lang.String;
var http = require('http');
var utils = require('utils');

var scratchReturnAddress = 'http://127.0.0.1:8089/';
    
scratchClients=[]

function scratch(command,ip){
    var players = utils.players();    
    var cmd=command.split("/");
    var index=-1;    
    var drona='';

    for(i=0;i<scratchClients.length;i++){
        if (scratchClients[i].ip==ip){
            console.log("target player: "+scratchClients[i].playerName);
            index=i;
            drona=scratchClients[i].drone;
            targetPlayer=scratchClients[i].targetPlayer;
            }
        }
    
    if(cmd[0]=='connect'){
            console.log('trying to connect to player ' + cmd[1]);
            playerName=cmd[1];
            for (pl in players){  //use server.getPlayer(playerName)
                if (players[pl].name.toLowerCase()==playerName.toLowerCase()){
                    targetPlayer=players[pl];
                    drona=new Drone (targetPlayer.location);
                    if (index==-1){ //new player
                        scratchClients.push({playerName:playerName, targetPlayer:targetPlayer,drone:drona, ip:ip});
                        index=scratchClients.length-1;
                        echo(targetPlayer, "Connected to Scratch client on IP "+ip);
                        }
                    else { //update existing player
                        scratchClients[index].playerName=playerName;
                        scratchClients[index].targetPlayer=targetPlayer;
                        scratchClients[index].drone=drona;
                        }
                    }
                }   
            if (index==-1) { //use of other command before connecting to any player
                console.log('Player not found');
                scratchReturn(-1, -1, 'player_not_found', ip); 
                return
                }    
            else { //return to Scratch current block
                bl=drona.getBlock();
                scratchReturn(bl.typeId, bl.data, 'connected', ip); //updates values for current block to be read by Scratch     
                }
            }                
        
    if (index==-1) { //use of other command before connecting to any player
        console.log('No target player defined');
        scratchReturn(-1, -1, 'no_target_player', ip); 
        return
        }
    console.log("command received -" + cmd[0]+";");
    switch(cmd[0]){        
         case 'boxCommand':   
         case 'box':    
                 if(cmd[1]==64){
                    drona.door(cmd[1]);
                        }
                else
                    drona.box(''+cmd[1]+':'+parseInt(cmd[2]),parseInt(cmd[3]),parseInt(cmd[4]),parseInt(cmd[5]));                
            break;
        case 'box0':
        case 'box0Command':               
                drona.box0(''+cmd[1]+':'+parseInt(cmd[2]),parseInt(cmd[3]),parseInt(cmd[4]),parseInt(cmd[5]));              
            break;
            
        case 'cylinder':
                drona.cylinder(''+cmd[1]+':'+parseInt(cmd[2]),parseInt(cmd[3]),parseInt(cmd[4]));              
            break;    
        case 'cylinder0':
                drona.cylinder0(''+cmd[1]+':'+parseInt(cmd[2]),parseInt(cmd[3]),parseInt(cmd[4]));              
            break;                
            
        case 'prism':
                drona.prism(''+cmd[1]+':'+parseInt(cmd[2]),parseInt(cmd[3]),parseInt(cmd[4]));              
            break;    
        case 'prism':
                drona.prism(''+cmd[1]+':'+parseInt(cmd[2]),parseInt(cmd[3]),parseInt(cmd[4]));              
            break;            
                    
        case 'rainbow':
                drona.rainbow(parseInt(cmd[1]));              
            break;    
            
        case 'bed':
                drona.bed();              
            break;
        
        case 'torch':
                drona.hangtorch();              
            break;

        case 'stairs':
                drona.stairs(''+cmd[1]+':'+parseInt(cmd[2]),parseInt(cmd[3]),parseInt(cmd[4]));              
            break;            

        case 'wallsign':
            textArray=[];
            for (i=1; i<5; i++)
                textArray.push(cmd[i]);
            drona.wallsign(textArray);              
            break;    
            
        case 'summon':   //summons mobs using Scriptcraft predefined drone's summon method
            console.log("summon "+cmd[1]);
            drona.spawn(cmd[1]) ;           
            break ;
            
            
        case 'moveDrone':
            console.log("before moveDrone: " + parseInt(10*drona.x)/10 + ":" + parseInt(10*drona.y)/10 + ":" + parseInt(10*drona.z)/10);
            switch(cmd[1]){    
                case 'reset':
                    drona=new Drone (targetPlayer.location);
                    scratchClients[index].drone=drona;               
                    break;
                case 'up':
                    drona.up(parseInt(cmd[2]));                    
                    break;
                case 'down':
                    drona.down(parseInt(cmd[2])); 
                    break;
                case 'left':
                    drona.left(parseInt(cmd[2])); 
                    break;
                case 'right':
                    drona.right(parseInt(cmd[2])); 
                    break;
                case 'fwd':
                    drona.fwd(parseInt(cmd[2])); 
                    break;
                case 'back':
                    drona.back(parseInt(cmd[2])); 
                    break;
                case 'turn':
                    drona.turn(parseInt(cmd[2])); 
                    break;
                case 'save_chkpt':
                    drona.chkpt(parseInt(cmd[2])); 
                    break;
                case 'goto_chkpt':
                    drona.move(parseInt(cmd[2])); 
                    break;
                }
            //console.log("after moveDrone: " + parseInt(100*drona.x)/100 + ":" + parseInt(100*drona.y)/100 + ":" + parseInt(100*drona.z)/100);            
        bl=drona.getBlock();
        scratchReturn(bl.typeId, bl.data, 'ok', ip); //updates values for current block to be read by Scratch
        break;
    }   
};



function scratchReturn(bltype, bldata, result, ip){ //updates values for current block to be read by Scratch
    var http = require('http');
    http.request( scratchReturnAddress + bltype + '/' + bldata + '/' + result + '/' +ip,function(responseCode, responseBody){console.log(  responseBody );});
}

exports.scratch=scratch
It keeps track of IPs for each client so you can have multiple connections from different computers. You can leave 127.0.0.1 for scratchReturnAddress as the processes run on the same machine, and the port must be the same as the second one from mc.js (8089).
On the client you will have to use MCextension.json file for Scratch. The port must be the same as the first port defined in mc.js (8088), but you need to update the IP address to match the server’s address if you are using a separate computer. You should also update the default player, replacing playerName with the one you will use most frequently.
{
   "extensionName": "Minecraft",
   "extensionPort": 8088,
   "host":"127.0.0.1",
   "useHTTP": true, 
   "blockSpecs": [
     [" ", "Connect User %s", "connect","playerName"],
     [" ", "box blType:%n blData:%n width:%n height:%n depth:%n", "boxCommand", 1, 0, 1, 1, 1],
     [" ", "box0 blType:%n blData:%n width:%n height:%n depth:%n", "box0Command", 1, 0, 1, 1, 1],
     [" ", "prism blType:%n blData:%n width:%n depth:%n", "prism", 1, 0, 3, 1],
     [" ", "prism0 blType:%n blData:%n width:%n depth:%n", "prism0", 1, 0, 3, 1],
     [" ", "cylinder blType:%n blData:%n radius:%n height:%n", "cylinder", 1, 0, 5, 1],
     [" ", "cylinder0 blType:%n blData:%n radius:%n height:%n", "cylinder0", 1, 0, 5, 1],    
     [" ", "stairs blType:%n blData:%n width:%n height:%n", "stairs", 1, 0, 1, 1],    
     [" ", "rainbow radius:%n", "rainbow", 12],     
     [" ", "place bed", "bed"],
     [" ", "hang torch", "torch"],
     [" ", "wallsign message :%s :%s :%s :%s", "wallsign", "", "", "", ""],
     [" ", "move drone %m.commands %n", "moveDrone", "fwd", 1],
     [" ", "summon %m.entities", "summon", "Chicken"],
     ["r", "blockType", "blockType"],
     ["r", "blockData", "blockData"],
     ["r", "result", "result"]
   ],
   
   "menus":{
        "commands": ["fwd", "back", "left", "right", "up", "down", "turn", "reset", "save_chkpt", "goto_chkpt"],
        "entities": ["Chicken", "Cow", "Wolf", "Pig", "Sheep", "Rabbit", "Horse", "Ocelot", "Villager", "Zombie", "Skeleton", "Creeper", "Spider"]
   }
 
}
Pressing Shift and clicking File in Scratch will provide access to Import experimental HTTP extension (the last option in the list) for opening the MCextension.json file.
By doing this, in the More blocks category you will have access to new blocks and variables. Before issuing any other command you should use Connect User and the name of a player with an open MC session on the server as a parameter. When connected, it will put a message in Minecraft chat and will automatically create a drone at player’s position, which will execute all the commands.
The new blocks defined in MCextension.json file try to replicate some of the functions that Walter Higgins defined in the drone plugin. For short descriptions of those functions and needed parameters please check https://github.com/walterhiggins/ScriptCraft/blob/master/docs/API-Reference.md#drone-plugin.
The box, prism, cylinder and rainbow are used to create solid structures, while box0, prism0 and  cylinder0  are for hollow structures – just walls without ceiling and floor.You can specify the material – block type and block data – and the dimensions.
Stairs, bed, torch and wallsign are used to place specific elements which must take into account player’s orientation.
The move drone function tells the drone where to move. The last drone position will be remembered so if you want to start again from the player’s position, you have to use move drone reset or Connect user again.
Summon is used to spawn the mobs from the predefined list. You can update this list for new mobs.
At the end of the file there are some variables updated by the Minecraft server:  blockType and blockData contain information about the block where the drone is, while result contains the result of last executed command.
If you want to check the values for blockType and blockData, you should insert a delay  of at least 0.2 secs (using standard Scratch block) after the last move drone instruction before using them.

Known issues

Sometimes commands are not executed in order, especially when the server is busy. It’s better to avoid launching command sequences from more than one computer at the same time, although it could work.
move drone save_chkpt and move drone goto_chkpt don’t work yet.

Future developments

Hunting for bugs, adding new functions, showing the equivalent Javascript commands on screen.

 

Using Scratch & Scriptcraft (& more) to teach kids programming in Minecraft – updated configuration

Scratch-logo-outline

&

9ccf0-minecraftlogo

The first solution that I found to make Scratch work together with Minecraft & Scriptcraft, described here, used Node RED to transform http commands sent by Scratch into mqtt packets, brokered by a mosquitto server and finally received by Scriptcraft MQTT extension.

Reading the awsome post Child Processes, Streams, and Minecraft Server Management via Text Message using Node.js by Kevin Whinnery, I discovered a much easier way to send commands from Scratch to Scriptcraft.

The Node.js script below launches Minecraft server and also creates a very simple http server process that will transfer commands directly to Scriptcraft:

screen-shot-2016-09-23-at-20-33-04

The servers listens to port 8088, the same used by the Scratch extension:

screen-shot-2016-09-23-at-20-48-23

As with the previous setup, the most important part is done using Scriptcraft, the mod created by Walter Higgins that lets you write Minecraft plugins using Javascript.

9xth1ei

The /js scratch() call in Node.js script invokes the Javascript function scratch that will interpret the commands received from Scratch. For now it buffers the command until a build instruction is received, then proceeds to execute them in order, inserting also delays based on the complexity of the building instructions (i.e. dimension of impacted areas).

Below is a very basic form of scratch() function working with only one client, that you can paste into a .js file saved in \Scriptcraft\plugins folder.

 var Drone = require('/drone/drone').Drone;
 var foreach = require('utils').foreach;
 var utils = require('utils');
 var connected = false;
 var drona = '';
 var targetPlayer = '';
 var playerName = '';

 function scratch(command,ip){ //ip not used in this version
 var players = utils.players();
 var cmd=command.split("/");

 if(cmd[0] == 'connect'){
   console.log('trying to connect to player ' + cmd[1]);
   playerName=cmd[1];
   for (pl in players){
     if (players[pl].name.toLowerCase()== playerName.toLowerCase()){
       targetPlayer = players[pl];
       echo(targetPlayer, 'Connected to Scratch client');
       drona = new Drone (targetPlayer.location);
       connected = true;
       }
     }
   }
 if (!connected) { //use of other command before connecting to any player
   console.log('Not connected to any player');
   return
   }
 console.log("command received -" + cmd[0] + ";");
 switch(cmd[0]){
   case 'boxCommand':
   case 'box':
     drona.box('' + cmd[1] + ':' + parseInt(cmd[2]), parseInt(cmd[3]), parseInt(cmd[4]), parseInt(cmd[5]));
   break;
   case 'box0':
   case 'box0Command':
     drona.box0('' + cmd[1] + ':' + parseInt(cmd[2]) ,parseInt(cmd[3]), parseInt(cmd[4]), parseInt(cmd[5]));
   break;
   case 'moveDrone':
     switch(cmd[1]){
       case 'reset':      
         drona=new Drone (targetPlayer.location);
       break;
       case 'up':
         drona.up(parseInt(cmd[2]));
       break;
       case 'down':
         drona.down(parseInt(cmd[2]));
       break;
       case 'left':
         drona.left(parseInt(cmd[2]));
       break;
       case 'right':
         drona.right(parseInt(cmd[2]));
       break;
       case 'fwd':
         drona.fwd(parseInt(cmd[2]));
       break;
       case 'back':
         drona.back(parseInt(cmd[2]));
       break;
       case 'turn':
         drona.turn(parseInt(cmd[2]));
       break;
     }
     break;
   }
 };
 exports.scratch=scratch;

This is an example of some functions created in Scratch screen-shot-2016-09-23-at-21-18-27

And this is how it looks:

I’m still looking for a solution to access in Scratch values from Minecraft world. It will make more sense if commands are no more buffered until the build instruction is received, but executed instantly.

ScriptCraft – Javascript Programming in Minecraft

ScriptCraft is a plugin created by Walter Higgins for Minecraft servers, that lets you use Javascript within the game for creating mods, mini-games or automating building tasks. It is available for CanaryMod and CraftBukkit (now discontinued ) servers.

You can issue simple commands (precedeed by /js) like

/js echo(1+1)

or create complex functions, saved in scriptcraft\plugins folder, that can be invoked in the same manner:

/js myfunction()

ScriptCraft comes with some extra functions (not part of Javascript language) that can help you in building complex structures. The simplest is box(), used for creating cuboids.

For example,

/js box(blocks.sandstone,3,3,3) 

will create a 3x3x3 sandstone cube at the location of the cursor.

There are also functions for prisms, cylinders, spheres and others that you can combine to create your on functions for building complex structures.You are not forced to know the type IDs and data values for Minecraft blocks, as you can use the ScriptCraft predefined blocks object. In the previous example I used blocks.sandstone instead of searching for the numeric value(s) for the specific material.

Using ScriptCraft to teach kids programming 

ScriptCraft is a powerful tool for Minecraft modding, but is also very useful to teach kids programming as they can see immediately the result of the issued commands. They can build big structures in seconds (sometimes the server will be overwhelmed by requests to create a box of hundreds blocks on each direction but that’s part of the fun) and they can also easily create simple mods to impress their friends so they surely are motivated to learn.

ScriptCraft comes with an Arrows plugin that modifies arrows to launch fireworks, to explode or to attract a lightning strike on impact, which adds the wow factor. While helping you to keep kids interested, ScriptCraft provides also the opportunity to explain them other related topics. During the installation/configuration I discussed with my 9 years old son about servers, networks, folders structure and similar concepts that he found boring previously. He follows now the JavaScript course on codecademy.com to be able to better use ScriptCraft.

Read more

Walter Higgins posted a detailed introduction to ScriptCraft on Github – The Young Person’s Guide to Programming in Minecraft and also wrote a book that will be available soon (April 2015) – A Beginner’s Guide to writing Minecraft  Plugins in JavaScript 

For latest version download and complete reference go to:

http://scriptcraftjs.org/

https://github.com/walterhiggins/ScriptCraft

Which Programming Language Should I Learn First?


Carlcheo.com guide on choosing the programming language to learn

So you want to learn programming. Maybe you have asked your developer friends for recommendations and get different answers. They explained with terms that you don’t understand (what is object-oriented?!). To help you to pick your first programming language to learn, here is an easy-to-understand infographic that recommends the best option, depending on your purpose and interest. Details such as learning difficulty, popularity, and average salary for each computer programming language are provided too.

Infographic: Which Programming Language Should I Learn First

full guide plus a list of best programming tools and resources for each programming language on http://carlcheo.com/startcoding

Apple introduces new programming language – Swift

https://developer.apple.com/swift/

From Apple press relase:

Swift is a powerful new programming language for iOS and OS X® that makes it easier than ever for developers to create incredible apps. Designed for Cocoa® and Cocoa Touch®, Swift combines the performance and efficiency of compiled languages with the simplicity and interactivity of popular scripting languages. By design, Swift helps developers write safer and more reliable code by eliminating entire categories of common programming errors, and coexists with Objective-C® code, so developers can easily integrate Swift into their existing apps. Xcode® Playgrounds make writing Swift code incredibly interactive by instantly displaying the output of Swift code.

The educational implications of Swift (by lizTheDeveloper)

http://lizthedeveloper.com/the-educational-implications-of-swift

Overlooked so far (I know, it hasn’t been that long) are the educational implications of Swift. Swift playgrounds are an amazing innovation in introducing new developers to concepts of programming that are often overlooked, and not well understood by new developers.

Why Swift isn’t just for programmers (by Alex)

http://medium.com/@au42/why-swift-isnt-just-for-programmers-a0b36b7d321c

Swift does something I wish I had when I was in high school: A way to program that’s interactive and fun — not just a text file.

Swift promises to make programming Cocoa apps easier and quicker than it’s predecessor Objective-C, all while retaining the same power and capabilities of a high-level language. While it requires OS X or iOS, it still has a much farther reach than MATLAB could ever hope to achieve. Currently, a home license will run about  for home use, and  for a full commercial license. In contrast, Swift will be on every updated OS X computer by next year for free — and Apple has no indication of dropping support any time soon. For a hobbyist with a Mac that wants a simple way to program, the choice is clear.

Swift’s benefits aren’t just monetary either. For a person with no experience programming, the ability to build a full app on Apple’s ecosystem with a minimal amount of programming is incredibly promising. Imagine being a new programmer and you’ve finally built something you want to share. With Swift, the transition to Playground to stand-alone app is near seamless, something MATLAB can’t really do.

Why Coders Are Going Nuts Over Apple’s New Programming Language (by Cade Metz)

Why Coders Are Going Nuts Over Apple’s New Programming Language

WWDC is a gathering of people who build software applications for Apple hardware devices—from the iPhone and the iPad to the Mac—and with its new language, dubbed Swift, Apple is apparently providing a much faster and more effective means of doing so, significantly improving on its current language of choice, Objective-C. With something that Apple calls an “interactive playground,” Swift is even exploring a highly visual kind of programming that may go beyond other mainstream languages. All those developers went nuts not only because they love Apple, but because the new language could make their lives that much easier.

Great collection of coding tutorials, recommended by programmers

http://teachyourselftocode.com/

 

Quote from the site:

Four years ago, a friend lent me his Rails book and I took it with me on a family vacation and learned Rails. I was happy to discover that programming itself was fun, but also realized it was power. Anything I could imagine, I could build. Suddenly I was having new ideas about every problem I encountered, and the ability to act on them. It changed the way I thought. 

Don’t believe people who say that learning to code is easy. Better to go in knowing that it’s hard and frustrating and that most of the time you will feel like you have no idea what you’re doing. There are a lot of people who will help you, at Meetups or on StackOverflow. But if you don’t know where to start, I made this site for you. 
Have fun. 

 

Teach programming using Minecraft: Pi Edition

http://minecraft.gamepedia.com/Pi_Edition

Minecraft: Pi Edition is a version of Minecraft developed for the Raspberry Pi. It is based on the already existing Pocket Edition but is slightly cut down, containing a revised feature set and support for multiple programming languages. The Pi Edition is intended as an educational tool for novice programmers. It is available to download for free, from the official downloads page and users are encouraged to open and change the game’s code using its API.[2]

On http://www.stuffaboutcode.com/p/minecraft.html there are some very useful resources for starting programming with Pi Edition API

Minecraft

Minecraft is brilliant, and the Pi edition doubly so, its free and the API is absolutely genius, allowing you to alter the world in real-time.  I have used the api to create a load of cools things, from a real-time clock to an operational cannon.

Which Coding Language Is Right For You? – an article by Selena Larson on readwrite.com

Coding is all the rage these days. Students of all ages and adults already in the workforce are increasingly encouraged to learn programming. Even President Obama said everyone should learn to code.

There are countless resources that offer the opportunity to learn different skills. From free online classes through services like Codecademy to multi-thousand dollar programs that promise to turn you into a bona fide software engineer in nine weeks.

But the question remains: Does everyone really need to learn to code?

The answer is no, at least if you’re not in an industry that relies on technology. But that pool of workers is gradually shrinking.

Gregg Pollack, founder of learn-to-code service Code School, says anyone who has to communicate with a developer at any point in their career should learn the basics of programming.

“If you learn some code, you’ll have a much better appreciation for what they do,” Pollack said. “Take the time to understand what it is and how to effectively communicate with programmers.” 

If your goal is to just understand programming concepts, you can play around with a few coding languages and see which one you prefer to learn. However, if you have a goal in mind—such as building an iOS application or a responsive Web page—you need the right tool for the job.

 

Read full article

Which Coding Language Is Right For You?

MIT App Inventor

http://appinventor.mit.edu/explore

What is App Inventor?

App Inventor lets you develop applications for Android phones using a web browser and either a connected phone or emulator. The App Inventor servers store your work and help you keep track of your projects.

You build apps by working with:

  • The App Inventor Designer, where you select the components for your app.
  • The App Inventor Blocks Editor, where you assemble program blocks that specify how the components should behave. You assemble programs visually, fitting pieces together like pieces of a puzzle.

Your app appears on the phone step-by-step as you add pieces to it, so you can test your work as you build. When you’re done, you can package your app and produce a stand-alone application to install.

If you don’t have an Android phone, you can build your apps using the Android emulator, software that runs on your computer and behaves just like the phone.

The App Inventor development environment is supported for Mac OS X, GNU/Linux, and Windows operating systems, and several popular Android phone models. Applications created with App Inventor can be installed on any Android phone. (See system requirements.)

Before you can use App Inventor, you need to set up your computer and install the App Inventor Setup package on your computer.