Skip to content

Instantly share code, notes, and snippets.

View tina1998612's full-sized avatar
:octocat:
DigitalNomad

李婷婷 Lee Ting Ting tina1998612

:octocat:
DigitalNomad
View GitHub Profile
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#define ll long long
#define N 100000+10
using namespace std;
int n,a[N],cnt,k,fst,maxi;
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <vector>
#define ll long long
#define N 100000+10
using namespace std;
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
long long cas,n,node,k,sum;
int main() {
scanf("%lld",&cas);
/*
* main.cpp
*
* Author: Peter
* Copyright (c) 2014-2015 HKUST SmartCar Team
* Refer to LICENSE for details
*/
#include <cassert>
#include <cstring>
*
* main.cpp
*
* Author: Peter
* Copyright (c) 2014-2015 HKUST SmartCar Team
* Refer to LICENSE for details
*/
#include <cassert>
#include <cstring>
import processing.serial.*;
import java.util.*;
Serial myPort;
int globalWidth = 80;
int globalHeight = 60;
int globalSpeed = 0;
int displaySpeed;
'use strict';
const PAGE_ACCESS_TOKEN = process.env.PAGE_ACCESS_TOKEN;
const APIAI_TOKEN = process.env.APIAI_TOKEN;
const WEATHER_API_KEY = process.env.WEATHER_API_KEY;
const express = require('express');
const bodyParser = require('body-parser');
const request = require('request');
const apiai = require('apiai');
import processing.serial.*;
import java.util.*;
Serial myPort;
int globalWidth = 80;
int globalHeight = 60;
int globalSpeed = 0;
int displaySpeed;
/*
* main.cpp
*
* Author: Peter
* Copyright (c) 2014-2015 HKUST SmartCar Team
* Refer to LICENSE for details
*/
#include <cassert>
#include <cstring>
void in_round_turn(){
if(!inAuto) return;
if(!in_round) {
if(center[1]>40 && center[2]>40) setServoDegree(-30), in_round = 1; // turn right if top center line is on the right side
else setServoDegree(30), in_round = 2; // else turn left
} else{ // if in round && center line points to black img
switch(in_round){
case 1:
setServoDegree(-30);
break;