Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
prologue
. concerning hobbits
this book is largely concerned with hobbits, and from its pages a reader may discover much of their character and a little of their history. further information will also be found in the selection from the red book of westmarch that has already been published, under the title of the hobbit. that story was derived from the earlier chapters of the red book, composed by bilbo himself, the first hobbit to become famous in the world at large, and called by him there and back again, since they told of his journey into the east and his return an adventure which later involved all the hobbits in the great events of that age that are here related.
many, however, may wish to know more about this remarkable people from the outset, while some may not possess the earlier book. for such readers a few notes on the more important points are here collected from hobbit-lore, and the first adventure is briefly recalled.
hobbits are an unobtrusive but very ancient people, more numerous formerly
from numpy import random
incircle = 0
for i in range(1,1000000):
x,y = random.rand(2)
x *= random.choice([-1,1])
y *= random.choice([-1,1])
if x**2 + y**2 < 1:
incircle += 1
print(4*incircle/i)
import gym
from gym import spaces
import numpy as np
import serial
import time
class PendulumEnv(gym.Env):
def __init__(self):
def read_message(self):
answer = str(self.connexion.readline())
return self.message_received(answer)
def message_received(self, a_value):
try:
a_value = str(a_value)[2:-5]
if a_value[0] == "D":
#self.log.debug(a_value[2:])