Aaron's Page

This is where I post about what I'm working on.

--- Day 1: Sonar Sweep ---

or..

How deep is too deep?

one art please

Part 1

Python

This was a straight forward exercise in indexing a list. Not a lot here, but time for me to learn an easy enough method to time my code:

from timeit import Timer

t = Timer(lambda: mycallingfunc(args))
print(t.timeit(number=1))

Go

I spent most of my time remembering how to open/read from files with a buffer to write a basic function to get my input. I'm super happy that I'm just going to reuse this every day. The processing of the lines was straight forward.

Part 2

Python

I felt a little guilty hardcoding some index offsets, but not guilty enough to go back an re-implement them dynamically based on a passed in offset value. 🤷

Go

The big difference was creating a helper function to convert from strings to ints because the fact that the conversion passes out two values rather than one (the value and an err) makes it hard keep tidy.

<< - Table of Contents - >>