Skip to content

Instantly share code, notes, and snippets.

View HavishNetla's full-sized avatar
💻
coding

Havish Netla HavishNetla

💻
coding
View GitHub Profile

Welcome to MDHacks Puzzles!

MDHacks has provided our begenir programmers with puzzles to complete and compete for prizes. Every time you complete a puzzle, submit your answer here and view your and your competitions progress here. Once you submit an answer check the leaderboard to see if you got it right. Good luck!

Some notes before you begin

  1. You can use any text based programming language
  2. When you submit don't worry about formatting or comments

Puzzle 1

Print out “Hello MDHacks” to the console

package org.firstinspires.ftc.teamcode.opModes.teleOp
import com.qualcomm.robotcore.eventloop.opmode.OpMode
import com.qualcomm.robotcore.eventloop.opmode.TeleOp
import com.qualcomm.robotcore.util.ElapsedTime
import org.firstinspires.ftc.teamcode.subsystems.Lift
import org.firstinspires.ftc.teamcode.subsystems.MecanumDrive
import org.firstinspires.ftc.teamcode.subsystems.Robot
import org.firstinspires.ftc.teamcode.util.Pose2d
import org.firstinspires.ftc.teamcode.util.UtilToggle
package org.firstinspires.ftc.teamcode.subsystems;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.DcMotorEx;
import com.qualcomm.robotcore.hardware.DigitalChannel;
import com.qualcomm.robotcore.hardware.HardwareMap;
import com.qualcomm.robotcore.hardware.Servo;
import org.firstinspires.ftc.robotcore.external.Telemetry;
import org.firstinspires.ftc.teamcode.util.PIDController;
#!usr/bin/env python
import socket
import time
import threading
import numpy
from inputs import devices
import math
HOST = "192.168.1.184" # Standard loopback interface address (localhost)
import socket
import ast
from ev3dev2.sound import Sound
from ev3dev2.motor import LargeMotor, MediumMotor, OUTPUT_A, OUTPUT_B, OUTPUT_C, OUTPUT_D, SpeedPercent
from ev3dev2.sensor import INPUT_1
from contextlib import closing
sound = Sound()
import socket
from contextlib import closing
import time
import threading
import numpy
from inputs import get_gamepad
HOST = "192.168.1.184" # Standard loopback interface address (localhost)
PORT = 65432 # Port to listen on (non-privileged ports are > 1023)
#!/usr/bin/env python
import socket
import ast
from contextlib import closing
HOST = '127.0.0.1' # The server's hostname or IP address
PORT = 65432 # The port used by the server
#a = LargeMotor(OUTPUT_A)
import socket
import time
from contextlib import closing
HOST = '192.168.1.171' # The server's hostname or IP address
PORT = 65432 # The port used by the server
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s:
print("conectiong")
print( s.connect_ex((HOST, PORT)))
import socket
from contextlib import closing
HOST = '127.0.0.1' # The server's hostname or IP address
PORT = 65432 # The port used by the server
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s:
s.connect((HOST, PORT))
s.sendall(b'Hello, world')
data = s.recv(1024)
import socket
UDP_IP = "127.0.0.1"
UDP_PORT = 8221
MESSAGE = "Hello, World!"
print ("UDP target IP:" + "127.0.0.1")
print ("UDP target port:" + "8221")
print ("message:" + MESSAGE)