Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Align two columns | Challenges
Python Knight

bookChallenge: Align two columns

Welcome to the "Align Two Columns" challenge!

Let's recap the knight methods and features you've learned:

Knight Methods:

  • go_right(), go_left(), go_up(), go_down(): Move the knight one cell in the specified direction.
  • pick_coin(): Pick up coin from the map and add it to your inventory.
  • put_coin(): Place coin from your inventory onto a cell.
  • object_up(), object_down(), object_right(), object_left(): Determine the object in the next cell in the specified direction, returning "wall", "coin", or "empty".

Programming Concepts:

  • Functions: Create reusable blocks of code to perform specific tasks.
  • Decomposition: Break down complex problems into smaller, manageable parts.
  • Loops: Use for and while loops to repeat actions.
  • Conditional Statements: Use if-else statements to make decisions based on conditions.
Task

Swipe to start coding

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 6. ChapterΒ 4
knight.py

knight.py

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

Awesome!

Completion rate improved to 2.94

bookChallenge: Align two columns

Swipe to show menu

Welcome to the "Align Two Columns" challenge!

Let's recap the knight methods and features you've learned:

Knight Methods:

  • go_right(), go_left(), go_up(), go_down(): Move the knight one cell in the specified direction.
  • pick_coin(): Pick up coin from the map and add it to your inventory.
  • put_coin(): Place coin from your inventory onto a cell.
  • object_up(), object_down(), object_right(), object_left(): Determine the object in the next cell in the specified direction, returning "wall", "coin", or "empty".

Programming Concepts:

  • Functions: Create reusable blocks of code to perform specific tasks.
  • Decomposition: Break down complex problems into smaller, manageable parts.
  • Loops: Use for and while loops to repeat actions.
  • Conditional Statements: Use if-else statements to make decisions based on conditions.
Task

Swipe to start coding

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

close

Awesome!

Completion rate improved to 2.94
SectionΒ 6. ChapterΒ 4
knight.py

knight.py

some-alt