Você está na página 1de 16

Introduction to

Primary Author: Steven Vorona


Contributors: Alex Yao, Emily Liu, Anjali Nambrath, Aneesh Agrawal, Zak
Dasaro, Arvind Yalavarti, Daniel Goodman, Yogi Koppol

The American Computer Science League

Similar to math competitions for code


and computer-based mathematics/logic
Two parts
Short problems
Program

Short Problems

Based on computer logic


(similar to logic in real life)
These use computer logic:
Computer number systems
Boolean algebra
Digital electronics

Brief introduction to logic

Based on a system of inputs and outputs


of saying true and false in different
ways
0 and 1 (Binary)
Low and high (Digital electronics)
0 and Low = False ; 1 and High = True

Simple computer logic:

An example of logic in real life


(a) If John walks the dog and (b) Sally
feeds the cat, are a and b true?
This example in comp. sci. form:
a is true and b is true, a && b = ?

Explanation

John walks the dog is true, as opposed to


John neglecting his dog
Sally feeds the cat is also true, as
opposed to starving her cat
Both parts a and b are true, therefore
output is true.

The system
Uses different operations to relate inputs
Or
And
Nor
Nand
Xor
Negation (Not)
The ones in bold are a good place to start learning

Format

During lunch you get a limited amount


of time to complete 5 problems (only
short problems during this time)
During the weekend, you will be given a
program to write with an intended input
and output

ACSL Programs

Given:
A description of the programs function
A sample input with correlating sample output
You must make your program run so it works
with both the sample inputs and ALL viable
inputs

Rules

Make it work with given inputs/outputs


72 hours to write it
Cant talk about your solution or other
solutions
Tl;dr: You get a weekend to write it without cheating

Contest 1: The Ad Hoc Problem

In the first contest, the programming


problem is always straightforward
Follow the listed instructions carefully
Check and test for edge cases
Good luck!

Resources:
http://hthsroboticsandcoding.weebly.com/ (Past Problems)
https://www.codecademy.com/ (Learning Coding)
https://docs.google.com/document/d/1fi8S2KvZLtVyNfb8UjsKSx
c1XcHI0k5eoBZg1tT6us4/ (Submission Instructions)
http://codeforces.com/ (Advanced Problems)

Practicing for Programming


Brush up on syntax of your primary language
Looping structures
Logic/boolean operators
Preventing short-circuiting (accepting all
possible inputs except the ones that will not
mathematically work)
Make your code clean!
We will talk about clean/pragmatic code in next lesson

Programming Practice:

* For best results, find


qualification
problems from
previous years.
(Google Code Jam) *

Code Chef (Coding contests/competitions, with a good system of


getting new programmers started)
Google Code Jam (practice at a higher level with programs of a
similar type to ACSL) *
Codecademy (learn everything for writing code)
/r/dailyprogrammer (subreddit for programming with upvoted
solutions)
http://www.acsl.org/samples.htm (Sample problems from prior
years)

If you want help with anything here:


Contact one of us:
Alex Yao - alyao@ctemc.org
Emily Liu - emliu@ctemc.org
Anjali Nambrath - annambrath@ctemc.org
Zak Dasaro - zadasaro@ctemc.org
Aneesh Agrawal - anagrawal@ctemc.org
Arvind Yalavarti - aryalavarti@ctemc.org
Daniel Goodman - dagoodman@ctemc.org
Steven Vorona - stvorona@ctemc.org
Yogi Ananth Koppol - ankoppol@ctemc.org

The End
-=+=-

Você também pode gostar