Back to Freecodecamp

Dialogue 2: Asking about Functions

curriculum/challenges/english/blocks/learn-how-to-use-code-related-concepts-and-terms/6632fd7b0b9f8087ff8aa3ba.md

latest2.4 KB
Original Source

--description--

Watch the video to understand the context of the upcoming lessons.

--assignment--

Watch the video

--scene--

json
{
  "setup": {
    "background": "company2-roof.png",
    "characters": [
      {
        "character": "Tom",
        "position": { "x": -25, "y": 0, "z": 1 }
      },
      {
        "character": "Sarah",
        "position": { "x": 125, "y": 0, "z": 1 }
      }
    ],
    "audio": {
      "filename": "5.2-2.mp3",
      "startTime": 1
    },
    "alwaysShowDialogue": true
  },
  "commands": [
    {
      "character": "Tom",
      "position": { "x": 25, "y": 0, "z": 1 },
      "startTime": 0
    },
    {
      "character": "Sarah",
      "position": { "x": 70, "y": 0, "z": 1 },
      "startTime": 0.5
    },
    {
      "character": "Tom",
      "startTime": 1,
      "finishTime": 5.26,
      "dialogue": {
        "text": "Sarah, I'm learning about functions in programming and I'm not sure how to use them.",
        "align": "left"
      }
    },
    {
      "character": "Sarah",
      "startTime": 5.38,
      "finishTime": 8.76,
      "dialogue": {
        "text": "Functions are like small reusable tasks that you can use in your code.",
        "align": "right"
      }
    },
    {
      "character": "Tom",
      "startTime": 9.48,
      "finishTime": 14.52,
      "dialogue": {
        "text": "Thanks for explaining, Sarah. I see many functions in our code but I'm not sure what each of these does.",
        "align": "left"
      }
    },
    {
      "character": "Sarah",
      "startTime": 15.26,
      "finishTime": 19.14,
      "dialogue": {
        "text": "No problem, Tom. To understand them, you can look at their names and comments.",
        "align": "right"
      }
    },
    {
      "character": "Sarah",
      "startTime": 19.52,
      "finishTime": 21.42,
      "dialogue": {
        "text": "Comments explain that function's purpose.",
        "align": "right"
      }
    },
    {
      "character": "Tom",
      "startTime": 21.88,
      "finishTime": 26.86,
      "dialogue": {
        "text": "Got it. So that means I should read the function names and comments to what these functions do.",
        "align": "left"
      }
    },
    {
      "character": "Sarah",
      "position": { "x": 125, "y": 0, "z": 1 },
      "startTime": 27.36
    },
    {
      "character": "Tom",
      "position": { "x": -25, "y": 0, "z": 1 },
      "startTime": 27.86
    }
  ]
}