How to teach Codea to a school class - ideas please

No Bluetooth but I might be able to get AirCode going

That would work, but be aware of the AirCode peculiarity described in this thread:
http://twolivesleft.com/Codea/Talk/discussion/3413/air-code-bug

Another way to spark interest may be to hold a competition, perhaps on several categories.
(eg. design, best game features, fastest code etc.)
Maybe have a class of juniors (2 years below) rank the games on those categories.
Then they’ll not make the game because the teacher says so, but because they have to appeal to an audience. If staged correctly, it’ll make the assignment that much more real to them.

Perhaps some will enjoy the fact that it is possible (though a bit involved) to put your code up in the appstore. Having an app in the appstore you made yourself is a really cool achievement for a teen.

Best of luck!

THanks @PTN. Not enough hours for finished games, I fear, but we’ll see…

If it helps at all, I wrote a small slideshow to explain how to use tables.

-- Tables

-- Use this function to perform your initial setup
function setup()
    math.randomseed(0)
    displayMode(FULLSCREEN)
    supportedOrientations(LANDSCAPE_ANY)
    lastChange = 0
    cam = {x = 0, y = 0, size = 45}
    tween.delay(5, function()
        anim({y = -HEIGHT}, 6, {y = -(2 * HEIGHT)}, 5, {y = -(3 * HEIGHT)}, 8, {y = -(4 * HEIGHT)}, 8, {y = -(5 * HEIGHT)}, 22, {y = -(6 * HEIGHT)}, 12, {y = -(7 * HEIGHT)}, 16, {y = -(8 * HEIGHT)}, 26, {y = -(9 * HEIGHT)}, 5)
    end)
    parameter.watch("cam.x + (2 * (ElapsedTime - lastChange))")
    parameter.watch("cam.x")
    parameter.watch("cam.y")
    parameter.watch("cam.size")
    parameter.watch("modelMatrix()")
    parameter.watch("viewMatrix()")
    parameter.watch("projectionMatrix()")
end

function anim(...)
    a(1, arg[1], arg)
end

function a(k, v, i)
    lastChange = ElapsedTime
    local j = v
    j["x"] = math.random(0, 50)
    tween(1, cam, j, tween.easing.sineInOut, function()
        tween.delay(i[k + 1], function()
            if i[k + 2] ~= nil then
                a(k + 2, i[k + 2], i)
            end
        end)
    end)
end

-- This function gets called once every frame
function draw()
    -- This sets a light background color 
    background(255)

    -- This sets the line thickness
    strokeWidth(3)

    -- Do your drawing here
    font("AmericanTypewriter")
    fontSize(24)
    fill(0)
    stroke(0)
    
    perspective(cam.size)
    camera(cam.x + (2 * (ElapsedTime - lastChange)), cam.y, WIDTH - 100, 0, cam.y, 0, 0, 1, 0)
    
    textMode(CENTER)
    
    translate(0, 0, 0)
    text("Let's talk about tables.")
    shift()
    text("A table can store multiple variables,\
all wrapped together in one variable.")
    shift()
    text("It looks like this:")
    text("{\"a\", \"b\", \"c\"}", 0, -36)
    shift()
    text("{\"a\", \"b\", \"c\"}")
    line(-150, -150, -48, -18)
    line(0, -200, 0, -18)
    line(150, -150, 48, -18)
    text("1st element", -150, -165)
    text("2nd element", 0, -215)
    text("3rd element", 150, -165)
    shift()
    fontSize(18)
    text("You can access an element by doing something like this:")
    fontSize(24)
    text("table[element]", 0, -36)
    shift()
    fontSize(18)
    text("Example:")
    fontSize(24)
    text("myTable = {1, 2, 3, \"a\", \"b\", \"c\"}", 0, -36)
    text("print(myTable[4])", 0, -66)
    fontSize(18)
    text("This will print \"a\", the fourth element in myTable.", 0, -102)
    strokeWidth(2)
    line(62, -20, 62, 60)
    strokeWidth(3)
    text("#4", 62, 72)
    shift()
    fontSize(24)
    text("Tables can also store named variables in them.")
    text("myTable = {abc = \"123abc\"}", 0, -36)
    shift()
    text("The \"abc\" variable inside myTable can be accessed")
    text("with either myTable.abc or myTable[\"abc\"].", 0, -36)
    shift()
    text("There are also other built-in table functions")
    text("Such as table.insert(table, value) will add", 0, -36)
    text("the value you supplied to the end of the table.", 0, -66)
    text("There are many other table functions, but we won't go over them now.", 0, -96)
    shift()
    text("Have fun playing with tables!")
    resetMatrix()
end

function shift()
    translate(0, -HEIGHT, 0)
end


Nice! =D> @SkytheCoder = the fastest coder in Codealand! <):slight_smile:

It reminds me a bit to LaTex… It would be also interesting to have, after the statements, an animated example.

@quezadav I actually started coding that about a week ago, kind of forgot about it after a day, remembered it now, finished coding it, and posted it here. :stuck_out_tongue:

@SkyTheCode - thanks!

@Ignatz I myself am not a teacher, I have a friend who is and from the advice I hear from him (this doesn’t apply to all students, everyone’s different) the best way to get quickly in to it is to do a couple worked examples of a problem, lets say we want them to learn for loops.
Show them a question such as: How can I compare a variable with all values in a table? Then work them through it, using either a boolean or a number so:

local var = 6
local bool = false
for k,v in pairs(egtbl) do
 if ? == var then 
  bool = ?
 end
end

The question marks would be gaps for students to fill in, this way you’re showing the students the syntax of the problem and then allowing them to build up on the problem themselves. This is just an example of let’s call them ‘lesson starters’ and my friend has been using these techniques at the start of each lesson and then recapping the previous lesson in a worked example for the next lesson. Hope this helps!

Edit: I know this may seem simple but it gets them active straight away.

Hi

I am also a teacher and will be introducing codea to my students next term, we have access to iPads for each student, I am new to coding with Lua and not used codea before so am looking forward to the challenge. I have been reading the posts and want to thank you for your input. I will put lessons together for my classes and will give you some feedback on how things go or have gone, Again thank you!

When I was doing a summer camp with Codea, the teachers gave us a little lesson of the basics, let us spend 30 minutes doing some project with those skills. Enough time to see if they are stuck or not, and to help them.

@Jewels, I’ve sent you a PM, see your inbox, I have quite a lot of stuff to share with you