This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Declare/initialize any useful variables here, including the temporary array | |
// to merge values into and then copy back into the parameter array. | |
/* | |
while the temporary array is not filled | |
if there are no more values in the left part of a, | |
move next value from right part of a into next index of the temporary array otherwise, if there are no more values in the right part of a, | |
move next value from left part of a into next index of the temporary array otherwise (values in each part) compare the first value in each part | |
move smallest value from a into next index of the temporary array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%.hex: %.asm | |
avra -fI $< | |
rm *.eep.hex *.obj *.cof | |
all: $(patsubst %.asm,%.hex,$(wildcard *.asm)) | |
upload: ${program}.hex | |
avrdude -c arduino -p m328p -P /dev/arduino-uno -b 115200 -U flash:w:$< | |
monitor: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string> | |
#include <vector> | |
//! Tokenize the given string str with given delimiter. If no delimiter is given whitespace is used. | |
void Tokenize(const std::string& str, std::vector<std::string>& tokens, const std::string& delimiters = " ") | |
{ | |
tokens.clear(); | |
// Skip delimiters at beginning. | |
std::string::size_type lastPos = str.find_first_not_of(delimiters, 0); | |
// Find first "non-delimiter". |