summaryrefslogtreecommitdiff
path: root/Beginning_C++_through_Game_Programming/ch3.ipynb
blob: 303271a9618b23789571755a98c8fc203aaddcec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
{
 "metadata": {
  "name": "ch3"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": "Chapter 3 : Function"
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": "example 3.1 page no :25"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "'''\nexample 3.1 page no :25\n'''\n\ndef newLine ():\n    print ''\n\n\nprint \"First Line.\" \nnewLine ()\nprint \"Second Line.\" ",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "First Line.\n\nSecond Line.\n"
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": "example 3.2 page no :25"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "'''\nexample 3.2 page no :25\n'''\ndef newLine ():\n    print ''\n\nprint \"First Line.\" \nnewLine ()\nnewLine ()\nnewLine ()\nprint \"Second Line.\" ",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "First Line.\n\n\n\nSecond Line.\n"
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": "example 3.3 page no :26"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "'''\nexample 3.3 page no :26\n'''\n\n\ndef newLine ():\n    print ''\n\n\ndef threeLine ():\n    newLine (); \n    newLine ();\n    newLine ();\n    \nprint \"First Line.\" \nthreeLine()\nprint \"Second Line.\" ",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "First Line.\n\n\n\nSecond Line.\n"
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": "example 3.4 page no :28"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# -*- coding: UTF-8 -*-\n'''\nexample 3.4 page no :28\n'''\n\ndef printTwice (phil):\n    print phil , phil\n\n\nprintTwice ('a');\n\n",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "a a\n"
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": "example 3.5 page no :28"
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "# -*- coding: UTF-8 -*-\n'''\nexample 3.5 page no :28\n'''\n\n\ndef printTwice (phil):\n    print phil , phil\n\nargument = 'b'  \nprintTwice (argument);",
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": "b b\n"
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": "",
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}