Thursday 28 May 2015

Beginner's Guide to Monk Abridged

How to use Monk, half of the Java-based Creatures development tool Jagent.

For the CCSF 2009, I wrote a tutorial on how to use Monk, half of the Java-based Creatures development tool Jagent.

Here is the tutorial, abridged and pictureless. I hope it helps.

For C3 and DS, agents can contain images, sounds, scripts, and information about where agents inject inside one file - the agent file. To extract the components of an agent, you must decompile it. Open Monk and set the type of file you're working with to "PRAY Source". Then drag and drop the .agent or .agents file onto the white square, where it says 'drop files here'.

Shortly afterwards, a folder will appear in the same directory to which you have your source agent file in. It will contain the sprites (s16/c16), sounds (wav), code (cos), catalogue file, and a txt file. The txt file is your PRAY file, it is what you need to master in order to compile agents.

To compile, you must understand how to PRAY. Your PRAY file can be saved as a .txt file. Have all the files you plan to compile together in the same folder as the PRAY file. Set Monk's mode to "PRAY Chunk" and drag and drop the PRAY .txt file onto the drop pad. It will create a new agent in the same folder as the pray source.

As an addendum, for Windows, it's best to move your agent or files from your Program files directory to somewhere else, like My Documents or the desktop before attempting to use Monk on it, as Windows doesn't appreciate Monk trying to unpack the files.

Saturday 9 May 2015

Coding classes should bring in everyone, not just children

Natalia Kucirkova, The Open University

The US and UK governments often mirror each other’s strategies when it comes to new education policies, and the recent introduction of coding into the school curriculum is no exception. From this September, all children aged five and up will have to learn to code, with the English coding revolution reflecting the vision encapsulated in President Barack Obama’s famous quote: “Don’t just play on your phone – program it!”

This change is being accompanied by a surge of resources aimed at helping children code creatively, with tools ranging from non-digital board games such as Robot Turtles to Google’s completely visual, character-free programming language. While some tools are commercially produced, others like The Missionmaker Core, have been developed through research and development projects in collaboration with schools.

It’s not just about the tools though. Concerns have been raised about the government’s inadequate training plans for teachers, and the risks of simplifying coding into procedural building blocks rather than conceptualising it as a new 21st century skill.

Mixed signals

The problem is that we’re getting our coding metaphors mixed up. Editor at Mother Jones, Tasneem Raja, argues that good coders are like good cooks who are able to create creative dishes out of some basic ingredients. Others compare coding to music and composing, there is a rhythm and melody to it. Another popular metaphor is that of poetry and art.

There are some important similarities between these metaphors: they all share the notion of working steadily towards proficiency. Those who code daily for hours are likely to be those who will be good at it. All three metaphors also implicitly point to audience awareness: a musician, poet or cook derive great delight from those they “code” for.

Code for and with the community

Another way of looking at coding is that of creating a story, built by a community. If we characterise coding in this way, we move the concept beyond linear code-writing to multi-dimensional coding, co-created by multiple authors, who actively make as well as consume the code.

Seeing coding as community-story projects can help answer questions around how to educate and foster a generation that loves coding rather than teaching a set of skills demanded by employers. It moves us to conceptualising coding as part of computing science which can be taught without touching a computer and which needs to be taught differently to different age groups.

Importantly, it implies that children and teachers have to collaborate to use online tools together. Teachers could code apps and websites with the children, for various contexts of use. We need more examples of apps which are innovative and meet specific needs, like we saw with the Devonport High School for Boys app, created by Plymouth students aged 14 and 15 for students, staff and parents to communicate better with each other.

Similarly, a group of students across year groups could collaborate on coding projects, borrow ideas and re-purpose them.

The power of the right metaphor

Seeing coding in this way might provoke a society-wide dialogue about empowering more people to become involved in the creation of the content they would like to see in the digital sphere. It could inspire politicians, the private sector or not-for-profit organisations to support free coding lessons to parents, grandparents and the general public, and so avoid widening the cross-generational digital divide even further.

It could also provide an accessible way in which to demonstrate the need for gender and racial diversity in the coding industry. With a new generation of community coders, we are less likely to see social software applications designed for and by predominantly young urban white men.

Metaphors have the power to create realities we would like to see. If we are ever to reduce the cross-generational gap in digital skills we have been experiencing since 1990s and the digital divides within generations on the rise since the early 2000s, using the metaphor of community storytelling seems like a good one.

The Conversation

This article was originally published on The Conversation. Read the original article.

Wednesday 6 May 2015

A Hearing Vendor

The Mini Empathic Vendor has a script which, when the main empathic vendor has its hearing turned on, causes it to vend food in response to educated norns complaining about hunger, and causes the three food vendors in the norn meso (justanut, lemon and carrot pods) to vend food if the mini empathic vendor is not close enough.

The advantage of using the catalogue files in this way is that it will work for norns speaking English or any other language - as long as they are educated, the vendor will be able to hear them. 

From "empathic vendor.cos", in the DS bootstrap:

** The Vendor's Ear
scrp 2 23 3 126
**this whole script will not fire unless ov00 is 1.  The ear is set as 'on' by default, but it can be set as 'off' by clicking the relevant button on the main empathic vendor.
    doif ov00 = 1
        lock
        sets va00 _p1_
        seta va01 _p2_
        inst
        doif va01 <> null
            targ ownr
            rnge 1000
** Check to see if you can actually see the speaker, if not.. get one of the pods to make some food!
            doif seee ownr va01 = 1
                setv va99 1
            endi
** Get the hunger sentences from the catalogues.
** Protein
**this sets va10 as being the first entry in the 'creature drives' catalogue that can be 'read' by the ear.  This is 'hungry for protein'.
            sets va10 read "Creature Drives" 1
** Starch
**this sets va11 as being the second entry in the 'creature drives' catalogue that can be 'read' by the ear.  This is 'hungry for starch'.
            sets va11 read "Creature Drives" 2
** Fat
**this sets va12 as being the first entry in the 'creature drives' catalogue that can be 'read' by the ear.  This is 'hungry for fat'.
            sets va12 read "Creature Drives" 3

** Check Sentence to see if it wants Fat (Food)
**do if the string-in-string search, in lower case, is nearby (va00) and has expressed a need for fat
            doif sins lowa va00 1 lowa va12 <> -1
                part 1
                frat 2
                anim [4 5 6 5 255]
                snde "empv"
**if you're too far away
                doif va99 = 0
** Tell the Carrot Pod to make a Carrot
                    inst
                    enum 2 23 4
                        doif targ <> null
                            mesg writ targ 0
                        endi
                    next
                    wait 15
                    targ ownr
                    part 1
                    frat 5
                    anim [1 2 3 2 255]
                    stop
**or if you're close
                elif va99 = 1
** Tell yourself to vend Peaking Pie
                    mesg writ ownr 1003
                    stop
                endi
            endi
** Check Sentence to see if it wants Protein (Fruit)
            doif sins lowa va00 1 lowa va10 <> -1
                part 1
                frat 2
                anim [4 5 6 5 255]
                doif va99 = 0
** Tell the Lemon Pod to make a Lemon
                    inst
                    enum 2 23 6
                        doif targ <> null
                            mesg writ targ 0
                        endi
                    next
                    wait 15
                    targ ownr
                    part 1
                    frat 5
                    anim [1 2 3 2 255]
                    stop
                elif va99 = 1
** Tell yourself to vend Yarn Fruit

                    mesg writ ownr 1002
                    stop
                endi
            endi
** Check Sentence to see if it wants Starch (Seeds)
            doif sins lowa va00 1 lowa va11 <> -1
                part 1
                frat 2
                anim [4 5 6 5 255]
                doif va99 = 0
** Tell the Nut Pod to make a Nut
                    inst
                    enum 2 23 5
                        doif targ <> null
                            mesg writ targ 0
                        endi
                    next
                    wait 15
                    targ ownr
                    part 1
                    frat 5
                    anim [1 2 3 2 255]
                    stop
                elif va99 = 1
** Tell yourself to vend Star Seeds
                    mesg writ ownr 1001
                    stop
                endi
            endi

        endi
    endi
endm

Saturday 2 May 2015

Learn computerese as a second language (that's code for code)

John Lenarcic, RMIT University
If horror meister Stephen King was a computer programmer, his language of choice would probably be COBOL: it’s quite verbose in exposition, has been around for ages and people still make a lot of money from it (through legacy systems and the like).
And even though he isn’t a programmer, King would still do well to study a computer language – as would the rest of us and our children.
Computer programming is not rocket science. Sure, it makes rocket science possible but anyone who can count, make choices and do things over and over again can probably learn how to program.
Fluency in one’s “native” computer tongue would be handy. But a firm grasp of sequence, selection and repetition is all that’s needed to code at beginner’s level, even in programming languages with exotic sounding names, such as Java, Python or C++.
Coding, of course, refers to the craft of designing, writing and debugging software. It may sound complex but it’s what we do when we draft a letter, compose a business report or author the Great Novel of our dreams.

simonov

If you learn how to read and write in English, with practice and several rejection slips under your belt, you can possibly become the next Stephen King. Ditto for computer programming: study how to read and write half-decent code and building the next Facebook can be within your reach.
Just watch the opening scenes of David Fincher’s 2010 film The Social Network to witness the humble origins of Mark Zuckerberg’s game-changing innovation: coding in all its simple glory as depicted eloquently in a Hollywood movie – who would have thought?
Here’s a simple algorithm that applies to both software and novels:
Writing works of greatness implies one has initially read likewise and recognised these to be so, which is the essence of being literate.
Stanford University’s Donald Knuth once touted the notion of “literate programming” as an approach whereby program logic is given depth of meaning with the frisson of natural language explanations, this being a cross between footnotes and critical interpretation.
The aim could have been to ultimately curl up in a comfy chair in front of an open fire with a bundle of good code to read but it didn’t quite work out that way. The pithy aphorism of MIT academics Hal Abelson and Gerald Sussman that “programs must be written for people to read, and only incidentally for machines to execute” is still only a pipe dream, but it shouldn’t be.

dullhunk

Programming languages are governed by syntax and semantics much like natural dialects. They can be viewed as tightly constrained variants of English, built as they are around the character set of the Latin alphabet, which is in part an accidental legacy of the American origins of this lingua franca of technology
(This may smack of Western imperialism to some, and in response the قلب (“alb”) programming language was recently created, based on Arabic script.)
The average English speaker may have a vocabulary of more than 30,000 words but a popular programming language such as Java only requires recognition of around 50 keywords and how they are used in context.

Ed Yourdon

Such brevity can mean getting things done with a computer language may require a penchant for puzzles or even poetry. A 2012 creative project soliciting “code poems” resulted in a limited edition publication now in its second edition.
The driving force behind this artistic endeavour, artist and engineer Ishac Bertran, is of the opinion that “code can speak literature, logic and maths".
A total of 190 poems were submitted by writers from 30 different countries for the first edition of “code (poems)”, with the only submission criteria being that a poem should have a maximum size of half a kilobyte and that it was required to be executable on a computer without falling over in a heap of error messages. In other words, it had to be a poem as bug-free software that actually worked.
Contributions in arcane dialects such as HTML,C#, SQL, Objective C and AppleScript were most welcome.

Get literate


Larry Atkin (front) and David Slate at the 10th ACM (Association for Computing Machinery) Computer Chess Championship in Detroit, Michigan (1979). laimagendelmundo

Coding literacy is paramount importance to ongoing global innovation. There is a broad and grave concern that students are being turned off studying computing courses at university due to a misguided apprehension of programming being difficult to absorb.
They may have been poorly taught at some institutions with ill-focused textbooks and this accumulated over time to computer programming being perceived as something non-mainstream, within the geek domain.
To counter this perceived difficulty, campaigns are emerging from several quarters that seek to promote coding as an empowering ability, much like a second language.
Code.org is a not-for-profit foundation set up to champion the need for computer programming education. With supporting testimonials from the two famous Bills, Clinton and Gates, Ashton Kutcher and will.i.am of the Black Eyed Peas, the website and accompanying rah-rah videos attempt to revamp coding as being fun, creative and within the scope of all citizens, not just propeller heads.

@matylda

Volunteer-led efforts such as Codeacademy and ScriptEd are spreading the mission in this regard.
The ScriptEd initiative is immersing low-income high schools from Harlem into learning environments in which coding skills can be acquired naturalistically. This is more Berlitz language school in tone than the often implicit desperation evident in the enculturation of clichéd “work-ready” technical graduates.
Coding should be seen for what it is: another way to communicate, unleashing a liberating force that can literally enable better living through programming.
Esperanto – conceived and created in the late 19th century – was a noble but failed attempt to engineer a universal natural language. The panoply of existing computer programming languages is similarly artificial and each in their own subtle way influence how their “speakers” think.
Now is the time for a new breed of polyglots to arise and creatively tinker away in the process. Can you afford to not wax lyrical in computerese?
The Conversation
This article was originally published on The Conversation. Read the original article.