1.2. Dragon Sprint 1¶
Assignment: Dragon Sprint 1
Complexity: easy
Lines of code: 20 lines
Time: 21 min
Warning: Don't delete code, assignment will be continued

Figure 1.17. Firkraag dragon from game Baldur's Gate II: Shadows of Amn¶
1.2.1. English¶
Non-functional requirements:
Commit and push the current state of the repository
Modify the game code from the previous version of the task
Save the code to solve the task in the
dragon
directoryWhen finished, add all files from
dragon
to the repositoryCommit and push changes to a central repository (Github)
Functional requirements:
Create Dragon with:
Name
Position on the screen
Dragon can:
Have position set to any place on the screen
Move in any direction by specified value
Assume left-top screen corner as an initial coordinates position:
Going right add to
x
Going left subtract from
x
Going up subtract from
y
Going down add to
y
Run the game:
Create dragon named "Wawelski"
Set Dragon's initial position to x=50, y=120
Set new position to x=10, y=20
Move dragon left by 10 and down by 20
Move dragon left by 10 and right by 15
Move dragon right by 15 and up by 5
Move dragon down by 5
1.2.2. Polish¶
Wymagania niefunkcjonalne:
Zapisz (commit) i wypchnij (push) aktualny stan repozytorium
Zmodyfikuj kod gry z poprzedniej wersji zadania
Zapisz kod do rozwiązania zadania w katalogu
dragon
Po zakończeniu dodaj wszystkie pliki z
dragon
do repozytoriumZapisz i wypchnij zmiany do centralnego repozytorium (Github)
Wymagania funkcjonalne:
Stwórz Smoka
Smok ma:
Nazwą
Pozycją na ekranie
Smok może:
Być ustawiony w dowolne miejsce ekranu
Być przesuwany w którymś z kierunków o zadaną wartość
Przyjmij górny lewy róg ekranu za punkt początkowy:
Idąc w prawo dodajesz
x
Idąc w lewo odejmujesz
x
Idąc w górę odejmujesz
y
Idąc w dół dodajesz
y
Scenariusz gry:
Stwórz smoka o nazwie "Wawelski"
Ustaw inicjalną pozycję smoka na x=1, y=2
Ustaw nową pozycję na x=10, y=20
Przesuń smoka w lewo o 10 i w dół o 20
Przesuń smoka w lewo o 10 i w prawo o 15
Przesuń smoka w prawo o 15 i w górę o 5
Przesuń smoka w dół o 5
Pozycja końcowa powinna być: x=20, y=40
1.2.3. Hints¶
Shortest solution has 24 lines of code
It is not a mistake: 'left by 10 and right by 15'
There are no errors in the assignment (testes on more than 300 trainings)
1.2.4. Solution¶
EN: Note, that this will spoil your fun and learning
PL: Zwróć uwagę, że to zepsuje Twoją zabawę i naukę