File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,7 +106,8 @@ def velocidade(self):
106106
107107 @velocidade .setter
108108 def velocidade (self , vel ):
109- self ._velocidade = 0 if vel < 0 else vel
109+ # Se velocidade for negativa, velocidade recebe 0
110+ self ._velocidade = max (0 , vel )
110111
111112 def acelerar (self ):
112113 self .velocidade += 1
@@ -127,14 +128,10 @@ def valor(self):
127128 return self ._valores [self ._cursor ]
128129
129130 def girar_a_direita (self ):
130- self ._cursor += 1
131- if self ._cursor == len (self ._valores ):
132- self ._cursor = 0
131+ self ._cursor = (self ._cursor + 1 ) % len (self ._valores )
133132
134133 def girar_a_esquerda (self ):
135- self ._cursor -= 1
136- if self ._cursor < 0 :
137- self ._cursor = len (self ._valores )- 1
134+ self ._cursor = (self ._cursor - 1 ) % len (self ._valores )
138135
139136
140137# ------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments