Skip to content

Instantly share code, notes, and snippets.

"""
Mars Rover
A simple program in Python that takes in commands and moves one or more robots around Mars.
- The world should be modelled as a grid with size m x n
- Your program should read the input, update the robots, and print out the final states
of the robots
- Each robot has a position (x, y), and an orientation (N, E, S, W)
- Each robot can move forward one space (F), rotate left by 90 degrees (L), or rotate
right by 90 degrees (R)
- If a robot moves off the grid, it is marked as ‘lost’ and its last valid grid position and

Keybase proof

I hereby claim:

  • I am dimi-tree on github.
  • I am dimitree (https://keybase.io/dimitree) on keybase.
  • I have a public key ASBABH2SR-MbX5zVCcWHv0FidopE_fNfoHzu1o9eTcRgPAo

To claim this, I am signing this object:

@dimi-tree
dimi-tree / 01_models.py
Last active November 17, 2020 07:16
Django REST Framework: understaning ModelSerializer
from django.db import models
class Member(models.Model):
# RE: null vs blank
#
# NULL https://docs.djangoproject.com/en/1.10/ref/models/fields/#null
# Avoid using null on string-based fields such as CharField and TextField because
# empty string values will always be stored as empty strings, not as NULL.
#
@dimi-tree
dimi-tree / cs.md
Last active July 25, 2016 09:47
compute science
@dimi-tree
dimi-tree / 3.py
Created February 14, 2016 19:32
Data Science from Scratch
"""Visualizing Data"""
import matplotlib.pyplot as plt
from collections import Counter
## Bar charts
def make_chart_simple_bar_chart(plt):
movies = ["Annie Hall", "Ben-Hur", "Casablanca", "Gandhi", "West Side Story"]
num_oscars = [5, 11, 3, 8, 10]