Showing posts with label Y10. Show all posts
Showing posts with label Y10. Show all posts

Wednesday, June 8, 2011

HTML+JS ON-THE-RUN

If you're really keen on coding and also maybe bored on the train? There's an App for that!
HTML Writer has coding shortcuts, its own testing browser, folder management and more. Get it HERE


Friday, June 3, 2011

Have you tried Komodo?

"Komodo Edit" is a free open-source text editor for PHP, HTML, Python, JavaScript and many others. It features the 'intellisense' feature of Dreamweaver but for free! It helps you write code by listing all the options as you go.


Click HERE


Monday, May 16, 2011

Download Scratch Now!


Scratch is a great way to learn programming and is capable of creating full games for playing online.
It's available for MAC and WINDOWS and is FREE!
Download the program here
If you create an account on their website you can download and upload games.

Friday, April 15, 2011

Y10 - Javascript - Document writing

<html>
<head>
<title>The Site types your words</title>
</head>
<body>
<script>
var words = prompt("Type some words");
function typewords()
{
document.writeln(words)
typewords()
}
typewords();
</script>
</body>
</html>

Y10 - Javascript - Colour change code

<html>
<head>
<title>DISCO</title>
</head>

<body>
<script type="text/javascript">
window.onload = BG_change;
function BG_change()
{
document.body.style.backgroundColor = 'rgb(' +
Math.floor(Math.random() * 256) + ',' +
Math.floor(Math.random() * 256) + ',' +
Math.floor(Math.random() * 256) + ')' ;
setTimeout ( 'BG_change()', 100) ;
}
</script>
</body>
</html>

Tuesday, March 22, 2011

Y10 - Document Production Rules

When producing a document try to follow these rules:
  1. No Underlining of Titles
  2. No centring of Titles (Except maybe on Posters)
  3. 3 Colours max
  4. Try to use a Colour Theme
  5. Use the Dominant Colours from images
  6. Don't leave unusual white space
  7. Try to use Columns more
  8. Always email and upload PDFs (Not WORD or PAGES etc)


Monday, March 14, 2011

Y10 Programming Lesson 5 - Polished coding

Cutting down the code from 240 lines to just 68!
Line 2 and 3 are still just:
Dim turn As String
Dim win As Boolean
Line 4 onwards is this code:
Sub butPressed(ByVal butnum As Integer)
        Me.Controls("Button" & butnum).Text = turn
        Me.Controls("Button" & butnum).Enabled = False
        If Button1.Text = turn And Button2.Text = turn And Button3.Text = turn Or _
             Button4.Text = turn And Button5.Text = turn And Button6.Text = turn Or _
             Button7.Text = turn And Button8.Text = turn And Button9.Text = turn Or _
             Button1.Text = turn And Button5.Text = turn And Button9.Text = turn Or _
             Button3.Text = turn And Button5.Text = turn And Button7.Text = turn Or _
             Button1.Text = turn And Button4.Text = turn And Button7.Text = turn Or _
             Button2.Text = turn And Button5.Text = turn And Button8.Text = turn Or _
             Button3.Text = turn And Button6.Text = turn And Button9.Text = turn Then
            win = True
        End If
        If win = True Then
            MsgBox(turn & " has won")
        End If
        If turn = "X" Then
            turn = "O"
        Else : turn = "X"
        End If
End Sub

Sub ResetGame()
        Dim buttonnumber As Integer
        For buttonnumber = 1 To 9
            Me.Controls("button" & buttonnumber).Text = ""
            Me.Controls("button" & buttonnumber).Enabled = True
        Next
        Button10.Text = "Reset"
        turn = "X"
        win = False
End Sub
FORM_LOAD and BUTTON10 now just have:
Call ResetGame()
Buttons 1 to 9 now just have (with the button number in brackets)
Call butPressed(1)

Friday, March 11, 2011

Y10 Programming Lesson 4 - Visual Basic X & O

The 2nd and 3rd lines of all the code should say:
Dim turn as string
Dim win as boolean
After double clicking on FORM 1 the code was:
turn = "X"
Here is the code we put on each button 1 to 9: (Change the button num to the button you are coding)
Button9.Text = turn
  If Button1.Text = turn And Button2.Text = turn And Button3.Text = turn Or _
       Button4.Text = turn And Button5.Text = turn And Button6.Text = turn Or _
       Button7.Text = turn And Button8.Text = turn And Button9.Text = turn Or _
       Button1.Text = turn And Button5.Text = turn And Button9.Text = turn Or _
       Button3.Text = turn And Button5.Text = turn And Button7.Text = turn Or _
       Button1.Text = turn And Button4.Text = turn And Button7.Text = turn Or _
       Button2.Text = turn And Button5.Text = turn And Button8.Text = turn Or _
       Button3.Text = turn And Button6.Text = turn And Button9.Text = turn Then
        Win = True
     End If
        If Win = True Then
            MsgBox(turn & " has won")
        End If
        If turn = "X" Then
            turn = "O"
        Else : turn = "X"
        End If

Monday, March 7, 2011

Y10 Programming Lesson 3

HTML iFrames + Javascript Random Numbers
<html>
<body>
<script>
window.onload = Steve();
function Pick3Numbers()
{
document.body.style.backgroundColor = 'rgb(' +
Math.floor(Math.random() *256) + ',' +
Math.floor(Math.random() *256) + ',' +
Math.floor(Math.random() *256) + ')' ;
setTimeout ('Pick3Numbers()', 10);
}
</script>
<center>
<iframe width="80%" height="50%" src="http://www.kingscollege.school.nz">
</iframe>
<iframe width="80%" height="50%" src="http://www.blogger.com">
</iframe>
</center>
</body>
</html>

Friday, March 4, 2011

Y10 Programming Lesson 2

Here's the code for PROMPTING (ASKING) what colour they want the page:
The Grey Code is ignored by the browser because of the /*...*/

<html>
<head>
<title>This is the Title</title>
</head>
<body>
<center><b>Hello My name is Mr Wells</b></center>
<script>
/* var WhatTheyHaveTyped = prompt("Please add a new Title: ");
document.title = WhatTheyHaveTyped; */

var rednum = prompt("How much red do you want on this page? - max 255")
var grnnum = prompt("How much green do you want on this page? - max 255")
var blunum = prompt("How much blue do you want on this page? - max 255")

function colourthepage()
{
document.body.style.backgroundColor = 'rgb(' + rednum + ',' + grnnum + ',' + blunum + ')';
}

colourthepage();
</script>
</body>
</html>

Thursday, March 3, 2011

Y10 Module - HTML / JAVASCRIPT INTRO

Here's the code to type into Notepad or Textedit (remember to set Textedit to Plain Text)
LESSON 1
<html>
<head>
<title>This is the Title</title>
</head>
<body>
<center><b>Hello My name is Mr Wells</b></center>
<script>
var WhatTheyHaveTyped = prompt("Please add a new Title: ");
document.title = WhatTheyHaveTyped;
</script>
</body>
</html>