edi9999 / jsqrcode

[deprecated] Lazarsoft's jsqrcode as a node module, object oriented, and with tests
Apache License 2.0
278 stars 63 forks source link

Cozmo output for yes or no input #53

Closed 01Programmer01 closed 6 years ago

01Programmer01 commented 6 years ago

Hello World, I have a problem with this code for @cozmo In the last section of the code _if a == 'No' or 'no ' or _if a == 'yes' or 'Yes'

For some reason, it just tells @cozmo to do both of the commands.

Anyway here is the whole script.

def cozmo_program(robot: cozmo.robot.Robot): robot.set_all_backpack_lights(cozmo.lights.blue_light) robot.say_text("Hi my name is cozmo, What is your name?").wait_for_completed()

myName = input()

robot.say_text("Well HI," + myName).wait_for_completed()

    # Drive forwards for 150 millimeters at 50 millimeters-per-second.
robot.drive_straight(distance_mm(150), speed_mmps(50)).wait_for_completed()
robot.drive_straight(distance_mm(-150), speed_mmps(100)).wait_for_completed()
robot.turn_in_place(degrees(-360)).wait_for_completed()

robot.say_text("Well do you like my moves " + myName).wait_for_completed()
a = input()

 #Does if a == 'No' or 'no' and then if a == 'Yes' or 'yes' no matter what you type
if a == 'No' or 'no':                                                     
    robot.say_text("Sorry for asking...").wait_for_completed()
    robot.turn_in_place(degrees(240)).wait_for_completed()
if a == 'yes' or "Yes":
    robot.say_text("Thank you very much" + myName).wait_for_completed()
    robot.drive_straight(distance_mm(-150), speed_mmps(100)).wait_for_completed()

cozmo.run_program(cozmo_program)

01Programmer01 commented 6 years ago

cozmosdk

edi9999 commented 6 years ago

Does this have anything to do with jsqrcode ? This seems to be python handling some kind of robot, whereas this library, which is now deprecated, handles the decoding of qrcodes.