added new project
No files matched your search
@@ -0,0 +1,59 @@
|
||||
\documentclass[12pt,a4paper]{article}
|
||||
|
||||
\usepackage{graphicx}
|
||||
\usepackage{abstract}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{listings}
|
||||
\usepackage{indentfirst}
|
||||
|
||||
\graphicspath{ {./images/} }
|
||||
\renewcommand{\abstractname}{\large{Timestamps}}
|
||||
|
||||
\setlength{\parindent}{0.5in}
|
||||
|
||||
\title{CPSC 315 - Homework \#1}
|
||||
\author{Chris Nutter\thanks{Dedicated to @QuesoGrande a.k.a. Jared D.}}
|
||||
|
||||
% --> Here we go, satellite radio, y'all get hit with a...
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
|
||||
\begin{abstract}
|
||||
\noindent
|
||||
\begin{center}\textbf{09/11/2020 - 05:21:00 PM}\end{center}
|
||||
I'm still learning LaTeX so bare with me on some of the formatting. Overtime I will improve.\\\\
|
||||
\begin{center}\textbf{09/12/2020 - 07:50:10 PM}\end{center}
|
||||
Some questions were hard to understand but I worked to the best of my ability. I didn't expect the reading to be decently long so my summary may be cut in some areas but I got the gist of was said.
|
||||
\end{abstract}
|
||||
|
||||
\tableofcontents
|
||||
\newpage
|
||||
|
||||
% -->
|
||||
|
||||
\section{Chapter 1 Summary}
|
||||
Being the year 2020, information is obtained so easily and so readily through any means necessary. Whether it be through our phones, computers, even refrigerators (yes it's real). Technology is rapidly evolving everyday. Sadly with every innovation, there is always someone, something, some person ready to stomp on the idea, make money from it, or worse \emph{spy on us}. The way we adopt technology is how things are innovated. People will choose ease over convenience any change they get. Whether we adopt such a radical change so quickly \emph{(i.e. smartphones)} or such a slow change over time \emph{i.e. personal computers} there are always advantages and disadvantages to each piece of technology invented.\par
|
||||
Technology has the ability to also transform us as humans. There is most likely going to be self-driving cars within 30 years from now that driving won't even be a concept for people anymore. Whether that is a good or bad thing is up to self-interpretation. It's widely known that long-term memory is important to human beings as it exercises our muscles in the brain and help keep us functioning. Technology is starting to replace a lot of the way we function as humans. It's not always for the worse however. Ease when it comes to livelihood isn't a bad thing in fact it helps humans stay relaxed and motivated. Changing our daily habits also helps us as humans stay active and keep our motors running. Technology is changing our perceptions of the world and it constantly keeps out aware of the world around us. Weirdly enough, the book mentions how the Amish know that technology is something that could potentially be a hazard to the world so they carefully examine technology before adopting it.\par
|
||||
There have been many huge milestones in technology that forever changed the world. While there are the simple ones including the invention of internet and personal computers, but there are bigger milestones that stand apart. The manual calculator is also called the abacus helped humans count with arithmetics over 2000 years ago. Later mechanical calculators were invented as a way to count very easily and was very useful for businesses to be able to add up transactions and take inventory which we now do to this day. Later down the line, the cash register was invented as a way to count money very easily during transactions and speed up the process drastically. Punched-card tabulation helped corporations take information very easily for records (especially for sensitive information). Once the year 1951 hit, commercial computers were invented by Ferrnanti which helped determine the election of Eisenhower which human experts could not accurately predict. After the invention of the commercial computer, people were eager for a faster way to be able to program on one. IBM was able to develop higher-level programming language which led to FORTRAN, a high-quality compiler. Each new invention helped aid the creation of a higher quality and more efficient iterations.
|
||||
Milestones were made in networking as well. Starting as early as the telegram which allowed people to communicate across states through Morse code. Later on the telephone which allowed audio communication which is still used to this day. Typewriters helped create the keyboard which we still use as a primary typing tool. Cloud computing made a huge jump starting at IBM which today is now readily available by anyone in the world with a computer and internet capability. The internet alone is considered one of the greatest and worst technological inventions in the world because of its wonderful and horrible use cases for many people.
|
||||
It is appropriate to say that technology (not just computer-based technology) is what drives change and helps create a better society but it isn't always the best thing for the world.
|
||||
\begin{center}\line(1,0){250}\end{center}
|
||||
|
||||
\section{Review Questions \#1-11}
|
||||
\begin{enumerate}
|
||||
\item Today is considered the Information Age because of how we have readily available information that we can get quicker than most people can think through their brains. Whether that be talking to Siri or searching on DuckDuckGo.
|
||||
\item Mathematic tables helped develop autonomous calculating machines because the more complex a problem got, the less time people wanted to spend calculating. Nowadays, we are able to create programs that can calculate faster and more accurately than the smartest man in the world.
|
||||
\item In the 1950s, we finally saw the first commercial computer which helped aid many companies financially. This is the time-frame of World War II, where we were destined to create bigger and better systems than any competing countries. The growth of the mechanical calculator helped aid creating a computer-based calculator that was able to help businesses keep inventory stock as well keep financially balanced.
|
||||
\item What led IBM and Burroughs Adding Machine Company to dominate their markets was innovation. Each company was able to create something bigger and better than their competitors (which were very few and far between). Just like businesses today, we constantly see competition and competition strives to make these companies innovate in their fields.
|
||||
\item Radar helped stimulate advances in computing by being a simple way to track weather patterns, control the skies through aviation, and help map the world and the areas around us whether it be through maps or through aviation.
|
||||
\item The Cold War helped bring about the personal computer because it was more of a widespread concept and idea. More successful concepts such as the microprocessor and higher-level programming helped aid people to an open onset of new ideas especially through Bill Gate's BASIC.
|
||||
\item Europe was a more dense and industrial place than British Isles so the telegram would need to be widespread across various companies which is why semaphore telegram could have been more used there..
|
||||
\item The telegraph was a very quick was of sending coded messages to people sometimes even quicker than telephone or wireless networks but was very limited in its way to convey messages. Telephones are a nice way to hear the voice of others however it used to require being connected at home and could cost a lot more money. Wireless networks is currently the superior way to convey messages however it has its ability to allow other unwanted people to read private conversations.
|
||||
\item Berners-Lee's system of hyperlink text was built on top of TCP/IP protocols which can connect any two computers through the internet which is still used today by every computer that can communicate online. Every PC has a unique public IP based on their location which is how we are able to traverse through the Internet and play online video-games.
|
||||
\item Four examples of how a social condition influenced the development of new information technologies include World War II, the Cold War, The Great Depression, and the Vietnam War. Most of these are wars because war is one of the major innovative factors because it drives competition.
|
||||
\item Social change brought about the adoption of new information technology in many ways. One of them being the invention of the mechanical calculator as it allowed people to calculate problems quicker and help their businesses thrive. Another would be the invention of the commercial computer which similar to the mechanical calculator helped the creation of jobs and people able to easily work for businesses through computing technologies. The last two would be the request for social reform after the Vietnam War showcased real footage of warfare which many people disapproved of and lastly the need for equality of races and sexes requiring more demanding work amongst the people of the world.
|
||||
\end{enumerate}
|
||||
|
||||
\end{document}
|
||||
@@ -0,0 +1,28 @@
|
||||
\documentclass[12pt,a4paper]{article}
|
||||
|
||||
\usepackage{setspace}
|
||||
\usepackage{indentfirst}
|
||||
|
||||
\setlength{\parindent}{0.5in}
|
||||
\onehalfspacing
|
||||
|
||||
\title{CPSC 315 - Homework \#2}
|
||||
\author{Chris Nutter\thanks{Dedicated to @QuesoGrande a.k.a. Jared D.}}
|
||||
|
||||
% --> Here we go, satellite radio, y'all get hit with a...
|
||||
|
||||
\begin{document}
|
||||
|
||||
\begin{center}
|
||||
{\textbf{\LARGE CPSC 315 - Homework \#2}
|
||||
\vskip 6pt
|
||||
\large Chris Nutter}
|
||||
\end{center}
|
||||
|
||||
\section{Chapter 2 Summary}
|
||||
\indent Ethics are one of (if not) the most important concepts in the business field. The chapter talks a lot about different ethical point of views, where they come from, and how they are important in defining morality or what is right and wrong to each person.\\
|
||||
\indent Ethical relativism is the theory that there is no moral right and wrong and that it is dependent on the person themselves; subjective relativism is that each person has decides what is right and wrong themselves. Cultural relativism is the theory of what is truly right and what is truly wrong rests on society itself and that no individual decides it on their own. Divine command theory is decided around good actions within God's parameters. Of course this more is reliant on religious affiliation (possibly God as the concept of a greater person than thyself). Ethical egoism is focusing on on each person's self-interest rather than other (egotistical complex). Kantianism is the thought that people's actions should be guided by moral laws which are universal laws (similar to the 10 Commandments). Act Utilitarianism is contradictory to Kantianism in that if the benefits exceed the harms it's a good action. Rule Utilitarianism is the theory that we should try to strive to make everyone happy whether that be making sacrifices or not. Social contract theory is the idea that everyone in a civilized society exists if the establishment of rules is in place and a government is capable of enforcing the rules. This concept is very important because it has been adopted by the United States during the creation of the nation. Rawl's theory of justice dictates that competition, if done properly, can help benefit production in social aspects.\\
|
||||
\indent These various aspects of ethics can be appropriately adapted towards the betterment of not just businesses but life as a whole. We adopt many theories dating back to the Renaissance to this day because of how accurately they can and have been portrayed Understanding ethics and ethical dilemmas allows proper ideas to flourish and business connections to be made.
|
||||
\begin{center}\line(1,0){250}\end{center}
|
||||
|
||||
\end{document}
|
||||
@@ -0,0 +1,106 @@
|
||||
\documentclass[12pt]{article}
|
||||
\usepackage[a4paper, total={6in, 10in}]{geometry}
|
||||
|
||||
\usepackage{graphicx}
|
||||
\usepackage{abstract}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{listings}
|
||||
\usepackage{indentfirst}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{titling}
|
||||
\usepackage{mwe}
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{setspace}
|
||||
|
||||
\graphicspath{ {./images/} }
|
||||
\renewcommand{\abstractname}{\small{\begin{center}Timestamps\end{center}\vspace{-4ex}}}
|
||||
|
||||
\setlength{\parskip}{3mm} % Add space between paragraphs.
|
||||
\setlength{\parindent}{0.5in}
|
||||
\onehalfspacing
|
||||
\setlength{\droptitle}{-35pt}
|
||||
|
||||
\fancypagestyle{plain}{
|
||||
\vspace{3ex}
|
||||
\fancyhead[L]{October 17th, 2020}
|
||||
\renewcommand{\headrulewidth}{0.5pt}
|
||||
}
|
||||
|
||||
\pretitle{\begin{center} \LARGE \textbf}
|
||||
\posttitle{\end{center} \vspace{-3ex}}
|
||||
\preauthor{\begin{center} \large}
|
||||
\postauthor{\end{center} \vspace{-3ex}}
|
||||
\predate{\begin{center} \small \emph}
|
||||
\postdate{\end{center} \vspace{-3ex}}
|
||||
|
||||
\title{Chapter \#3 Summary\\\Large+\\ Review Questions \#1-15}
|
||||
\author{Chris Nutter\thanks{Dedicated to @QuesoGrande a.k.a. Jared D.}}
|
||||
\date{CPSC 315}
|
||||
|
||||
% --> Here we go, satellite radio, y'all get hit with a...
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
|
||||
\begin{center} \vspace{-4ex}|\vspace{-3ex} \end{center}
|
||||
|
||||
\noindent\abstractname
|
||||
\begin{center}
|
||||
\normalsize\textbf{10/08/2020 - 01:58:55 PM}\\
|
||||
\end{center}
|
||||
\normalsize
|
||||
|
||||
\tableofcontents
|
||||
\vspace{4ex}
|
||||
|
||||
% --> First Chapter
|
||||
|
||||
\section{Summary}
|
||||
\indent The Internet being relatively new has changed the way we view humanity and the world as a whole. The Internet provides us with information in milliseconds which has helped countless people win arguments with people when they did not have the answer. The Internet is also the scariest invention since the Atomic Bomb as it has a huge potential to be the largest anti-privacy hotspot. Billion's of indexed pages allow for people to view information very quickly which is very useful because preserving facts is very important to maintaining a presence in society. The information is very easily manipulated however (especially on Wikipedia) which is easily edited to be stripped of "controversial information". Preserving information of all types is also something that is important as it prevents censorship in a world of progressive censorship being a problem. The book labels the Internet as "the best and worst of humanity" which is very, \emph{very} accurate; however, that can be labeled about most of the world in ways. The internet can be dark and twisted but also holds some of the greatest attributes of modern life. The worst of the Internet isn't even the "dark web", it's social media.\\
|
||||
\indent Social media is becoming the biggest red flag of society as of lately. Facebook, Twitter, Linkedin all use your information and sell them for use in many activities that you may not was be apart of. Often times too it's people under the age of 18 which is \emph{really} scary. Social media in closed conditions however (IRC, Direct message through secure SSL encrypted lines) is still a viable option.\\
|
||||
\indent Censorship is a very important novelty that is considered by many a human right. The Internet is the \#1 hotspot for preventing censorship. Anyone can create a website and make whatever they want for content and it'd be completely fine (assuming no illegal content is hosted). One problem with this is companies like Facebook who censor what you want to say on their platform that doesn't fit their narrative.\\
|
||||
\indent While we get closer to a completely technological age, life is breaching a very important stage of what we should the Internet be capable of and the limits we set upon it. Whether it be watching videos or reading articles, the Internet is something that will not go away and that is not a bad thing; we, however, need to acknowledge its faults and learn to improve it over time.
|
||||
|
||||
\section{Questions}
|
||||
\begin{enumerate}
|
||||
\item Spam is very popular for a multitude of reasons. Sending an email in batch (around 100,000 emails) can only up to 10 minutes which is faster than sending physical mail. Someone can spend that time hoping to achieve a couple of innocent people's information, or whatever they plan on achieving, just by sending an email.
|
||||
\item Spam is on the decline as people are finally starting to understand what spam looks like especially with spam filters. Google, despite being \emph{Google}, has created many magnificent algorithms including their spam filter. Their spam filter works 99\% of the time which is very impressive. Typically scams happen with advertisements on websites versus spam anymore.
|
||||
\item A good chunk of web browsing is done on mobile devices right now as it's quicker and easier to load a webpage on your phone on the go versus pulling out a laptop to look something up. My personal website is currently getting optimized for mobile layouts so it is very important to setup a mobile and base website layout. With apps, it's easier to view clean UI on an app versus just a plain webpage (especially) on mobile. People will take ease of capability nowadays so UI so becoming more important by the day.
|
||||
\item Texting is sent through radio towers while instant messaging is sent through the internet. Both have the ability to be encrypted which is good for the end users, but both have vulnerabilities. Instant messaging can still be tampered with by many people while texting is also a clean hotspot for spam messages.
|
||||
\item Facebook is a prime example of how social media has messed with news as they censor news outlets that do not fall under their agenda (typically conservative-based news outlets).
|
||||
\item The Internet is faster and easier than conventional newspapers. Pretty simple answer. However newspapers are still safer in a lot of ways being more of a public medium.
|
||||
\item Censorship is a person, company, outlet, etc. who silences a person for their point-of-view on topics whether that be physically silence or remove messages and anywhere in-between.
|
||||
\item The Internet is open to \emph{anybody}. Any human can buy a domain, host a server, and output whatever they want on the Internet. You cannot censor someone's website unless the government seizes your website for illegal content. News outlets, on the other hand, can cut off feed while you are talking.
|
||||
\item Broadcasters cannot say whatever they want because they are given a script to read from and if they deviate then they're finding a new job. Book publishers can make a story and send it out to anyone and that's out there for life.
|
||||
\item Sexting is very difficult to combat because with how encrypting is being done nowadays, lots people cannot tamper feeds as easily. At this point, it's up to the parents to teach their kids how to be responsible.
|
||||
\item The leading form of identity theft is probably done through social security. Your social security number is like a lock that is in your brain. If you give someone the lock, they will create duplicates and it's out there and you can never get a new one lock on your door.
|
||||
\item College students are fresh meat for identity theft because they are just starting life and they are able to use your information to affect the early stages of your employment.
|
||||
\item High-tech methods of identity theft:
|
||||
\begin{enumerate}
|
||||
\item Hacking into a bank account database.
|
||||
\item Creating a website that looks like you are selling a product but you are just stealing their credit card information.
|
||||
\end{enumerate}
|
||||
Low-tech methods of identity theft:
|
||||
\begin{enumerate}
|
||||
\item Robbing someone blindly.
|
||||
\item TeamViewer into someone's computer and pretending to be tech support.
|
||||
\end{enumerate}
|
||||
\item Cyberbullying is the concept of harassing an individual physically or mentally but using a technological product to aid.
|
||||
\item Technology releases dopamine similarly to pornography. Each click and sound you hear, your brain addresses and releases that dopamine which keeps you wanting to do it more and more. The more you do it the more your body gets inclined and hard to quick. It's very similar to nicotine or drugs.
|
||||
\end{enumerate}
|
||||
|
||||
\end{document}
|
||||
|
||||
% Possibly Important LaTeX Functions %
|
||||
% ================================== %
|
||||
|
||||
% \begin{figure}[hbtp]
|
||||
% \centering
|
||||
% \fbox{\includegraphics[width=13.8cm]{big_o.png}}
|
||||
% \caption{Big(O) Notation}
|
||||
% \end{figure}
|
||||
|
||||
% \begin{lstlisting}[language=Python]
|
||||
% print('hello world')
|
||||
% \end{lstlisting}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
\documentclass[12pt]{article}
|
||||
\usepackage[a4paper, total={6in, 10in}]{geometry}
|
||||
|
||||
\usepackage{graphicx}
|
||||
\usepackage{abstract}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{listings}
|
||||
\usepackage{indentfirst}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{titling}
|
||||
\usepackage{mwe}
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{setspace}
|
||||
|
||||
\graphicspath{ {./images/} }
|
||||
|
||||
\setlength{\parskip}{3mm} % Add space between paragraphs.
|
||||
\setlength{\parindent}{0.5in}
|
||||
\setlength{\droptitle}{-35pt}
|
||||
|
||||
\fancypagestyle{plain}{
|
||||
\vspace{3ex}
|
||||
\fancyhead[L]{October 31st, 2020 - Happy Halloween!}
|
||||
\renewcommand{\headrulewidth}{0.5pt}
|
||||
}
|
||||
|
||||
\pretitle{\begin{center} \LARGE \textbf}
|
||||
\posttitle{\end{center} \vspace{-3ex}}
|
||||
\preauthor{\begin{center} \large}
|
||||
\postauthor{\end{center} \vspace{-3ex}}
|
||||
\predate{\begin{center} \small \emph}
|
||||
\postdate{\end{center} \vspace{-3ex}}
|
||||
|
||||
\title{Chapter 4 Summary \& Review Questions}
|
||||
\author{Chris Nutter\thanks{Dedicated to @QuesoGrande a.k.a. Jared D.}}
|
||||
\date{CPSC 315}
|
||||
|
||||
% --> Here we go, satellite radio, y'all get hit with a...
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
|
||||
%\begin{center} \vspace{-4ex}|\vspace{-3ex} \end{center}
|
||||
\normalsize
|
||||
|
||||
\tableofcontents
|
||||
\vspace{4ex}
|
||||
|
||||
\begin{center} Content begins on next page. \end{center}
|
||||
|
||||
\newpage
|
||||
\doublespacing
|
||||
% --> First Chapter
|
||||
|
||||
\section{Chapter 4 Summary}
|
||||
\indent Intellectual property is a very controversial topic when involving a community of people. What each person creates and delivers to the community has the potential to be stolen by other people which is a problem. Intellectual property is also a power often abused by people who believe they own a specific word or brand when they really do not. Fair use is the concept that a product or service is a common good rather than an individuals creation.\\
|
||||
\indent With the evolution of technology, the Internet is something that is very widespread that it has caused problems for companies. Patents are a great way to protect against stealing of a product by publicly announcing and showcasing the design of the product or service at hand. It is very important to get a proper patent if a product is reaching headway and you are afraid of people stealing it. Every company has a problem with competition. If one person creates a product better than another, it could be game over for a company. That is why it is important to protect the property you have. The other side of the issue how companies could abuse a copyright system by copyrighting something they shouldn't or try to own a product that is something outside of the norm. For example, the YouTube channel "React" tried to copyright the word react and charge people money for the use of the concept which was a huge red flag and luckily they retracted.\\
|
||||
\indent When understanding property, people tend to think you have to have a physical product in hand which is not true. Intellectual property is just as important if not more because and idea someone has or concept, is still their property as long as they can document it. While it's true multiple companies can create similar products, property is the underlying concept that an idea or physical product is yours and no one can take that idea and use it. Copyright law is a very interesting subject for a lot of people as it what stops anyone from being able to get a movie or show for free legally. Obviously there are ways around copyright law but the concept still is in effect where we are not allowed to download a movie without paying. Piracy is still very rampant in society as it has been very easily replicated compared to the past.
|
||||
\newpage
|
||||
\onehalfspacing
|
||||
|
||||
\section{Review Questions}
|
||||
\begin{enumerate}
|
||||
\item Intellectual property is hard to protect because of the word itself "intellectual". Meaning any person can claim they had thought of an idea before someone steals it. Physical property is something someone physically has in hand which is a lot easier to prove.
|
||||
\item Locke's natural right says we cannot steal property which is definitely important for physical and intellectual property but the problem with intellectual property is it's hard to prove that it is not stolen from someone else.
|
||||
\item People are able to protect their intellectual property through patents or copyrights which are in place to protect things like intellectual property and physical property.
|
||||
\item Patents are publicly announced to the world so in theory if a company were to patent a product, everyone knows about it and how it functions while a trade secret is something the public does not know but it can "in theory" be stolen because it was not publicly shown through a patent.
|
||||
\item Option 3: Rajiv should have obviously talked with the team about their design because that is his time to tell them what he likes and doesn't like about the design. I guess he is trustworthy in his developers but he still should talk to them.\\Option 4: While he's finally talking to the team, he's forcing the team to use something they probably aren't familiar with.
|
||||
\item Fair use is the concept that a piece of work is able to be criticized and reviewed by the public while using the footage. Fair use is allowed to use the product at hand without providing the product through piracy means.
|
||||
\item YouTube is a prime example of how easy it is for people to violate copyright law because it's very easy to upload a video with content they shouldn't share.
|
||||
\item Fair use has so often been thrown away (especially on YouTube) because copyright holders are so protective of their product and YouTube rather than dealing with everything case by case, they just allow they companies to claim a video and move one.
|
||||
\item BitTorrent is easily used because it's the link between each peer-to-peer that was harder to find beforehand.
|
||||
\item This definitely is a case-by-case basis so it's hard to come to a solid conclusion but from what I'm understanding, the court's lack of understanding peer-to-peer system led to them concluding what peer-to-peer networks really are not, piracy.
|
||||
\item The most significant changes in the last 15 years was definitely the switch from physical to digital media. Sites like Napster put a damper on how we receive music and it's very different. Nowadays it's pretty standard to use a streaming service which is legal.
|
||||
\item If company A wants to create a product similar to company B, as long as they do not reference company B AND they do NOT use any code, it will not be violating copyrights.
|
||||
\item Closed source is the concept of a product being not open to the public so people cannot view the workings or code of a project.
|
||||
\end{enumerate}
|
||||
|
||||
\end{document}
|
||||
|
||||
% Possibly Important LaTeX Functions %
|
||||
% ================================== %
|
||||
|
||||
% \begin{figure}[hbtp]
|
||||
% \centering
|
||||
% \fbox{\includegraphics[width=13.8cm]{big_o.png}}
|
||||
% \caption{Big(O) Notation}
|
||||
% \end{figure}
|
||||
|
||||
% \begin{lstlisting}[language=Python]
|
||||
% print('hello world')
|
||||
% \end{lstlisting}
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
\documentclass[12pt]{article}
|
||||
\usepackage[a4paper, total={6in, 10in}]{geometry}
|
||||
|
||||
\usepackage{graphicx}
|
||||
\usepackage{abstract}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{listings}
|
||||
\usepackage{indentfirst}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{titling}
|
||||
\usepackage{mwe}
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{setspace}
|
||||
|
||||
\graphicspath{ {./images/} }
|
||||
\onehalfspacing
|
||||
|
||||
\setlength{\parskip}{3mm} % Add space between paragraphs.
|
||||
\setlength{\parindent}{0.5in}
|
||||
\setlength{\droptitle}{-35pt}
|
||||
|
||||
\fancypagestyle{plain}{
|
||||
\vspace{3ex}
|
||||
\fancyhead[L]{November 14th, 2020}
|
||||
\renewcommand{\headrulewidth}{0.5pt}
|
||||
}
|
||||
|
||||
\pretitle{\begin{center} \LARGE \textbf}
|
||||
\posttitle{\end{center} \vspace{-3ex}}
|
||||
\preauthor{\begin{center} \large}
|
||||
\postauthor{\end{center} \vspace{-3ex}}
|
||||
\predate{\begin{center} \small \emph}
|
||||
\postdate{\end{center} \vspace{-3ex}}
|
||||
|
||||
\title{Chapter 5 Summary \& Review Questions}
|
||||
\author{Chris Nutter\thanks{Dedicated to @QuesoGrande a.k.a. Jared D.}}
|
||||
\date{CPSC 315}
|
||||
|
||||
% --> Here we go, satellite radio, y'all get hit with a...
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
|
||||
%\begin{center} \vspace{-4ex}|\vspace{-3ex} \end{center}
|
||||
\normalsize
|
||||
|
||||
\tableofcontents
|
||||
\vspace{4ex}
|
||||
|
||||
\begin{center} Content begins on next page. \end{center}
|
||||
|
||||
\newpage
|
||||
% --> First Chapter
|
||||
|
||||
\section{Chapter 5 Summary}
|
||||
\indent Privacy is one of the essential human rights and it's something that makes each human feel safe and secure. Each day we progress, our society and government want to invade our privacy more and more in order to make money to people who want the information. Daily people are stripped of their social security, medical information, and phone numbers and sold to corrupt government agents or worse, China.\\
|
||||
\indent Modern technology makes it very easy for people to be susceptible to bad privacy standards. Facebook is a prime example of a company who makes a living off of its users giving as much information as possible. It's a scary fact that everyday people are losing social security numbers just because their credit card got "hacked" and the person didn't know better so they give up vital information. We live in a society nowadays where it is so easy to lose a huge chunk of your life.\\
|
||||
\indent Many organizations collect information on individuals and plan on selling to third-parties for profit. Any program or social media that they market as "free" will often use each individual as the product and sell the information. Facebook is insanely bad when it comes to their privacy aspects and have been shown to sell information to other people.\\
|
||||
\indent This last paragraph will summarize what to do to not get your information sold. Do NOT use social media. Every social media uses your information as a source of payment for the company. Do. Not. Use. Social. Media. Also do not give up your information to anyone. Use safe services to pay people (i.e. Paypal). Lastly, do not go online. That's obviously impossible so here are some nice things that can help you feel safer.
|
||||
\begin{enumerate}
|
||||
\item Get an Android phone and install a custom ROM with microG. It's a variant of Google Play Services that doesn't use Google and doesn't send traffic. You can block location, market, everything Google related. Very awesome. (Also it's really good on battery).
|
||||
\item Use an iPod for music. No Wifi/Ethernet means it cannot get hacked.
|
||||
\item USE A VPN. USE A VPN. USE A VPN!!! I recommend Private Internet Access or Mullvad.
|
||||
\item Use LastPass to randomly generate passwords.
|
||||
\item Do not give up any personal information to anyone. At all. Ever.
|
||||
\end{enumerate}
|
||||
\newpage
|
||||
\onehalfspacing
|
||||
|
||||
\section{Review Questions}
|
||||
\begin{enumerate}
|
||||
\item Being alone is the concept of no interaction with the people around you. Privacy is still being able to be around other people however they don't know things you do not want them to know. I prefer privacy but being alone is nice sometimes too.
|
||||
\item Excess privacy can lead to bad people running bad practices underneath the knowledge of the government (sex trafficking, looting, etc) while not enough privacy can lead to the knowledge of everyone around us and lead to a very insecure and pressuring society.
|
||||
\item Privacy is a prudential right as the philosophy stands that each human has an inherent right to life, liberty, and the pursuit of happiness. Liberty = privacy.
|
||||
\item Privacy is a positive right meaning that it's a good thing to have. I firmly believe that privacy should be expressed making it a positive right.
|
||||
\item Some information should be made public limited to criminal records so we understand our community and can act accordingly.
|
||||
\item One example of where a person has to disclose personal information would be applying for a credit card because your social security is linked to your own credit and using another SS is considered fraud.
|
||||
\item Retailers use loyalty cards to improve sales because the cards are to be paid to the companies and loyalty cards on their end add to a credit service.
|
||||
\item Personally I see NO benefit of public medical records because that's something I believe no one should disclose unless appropriate. The risks are far and wide. Disclosing medical records could lead to "leaking" of them to companies and targeted ads towards the person with specific diseases. If I get ads based around my medical records, I won't be happy.
|
||||
\item Cookies from a web site can be stored and saved on the websites side and could potentially be sold to other companies.
|
||||
\item Data mining is the concept of a company taking information from a source while collaborative filtering is the effort of a group getting disclosed information and grabbing the information it needs.
|
||||
\item Opt-in policy is where the person MUST say yes or no to a policy at hand while opt-out policy they are AUTOMATICALLY said yes and have to remove themselves.
|
||||
\item Be safe on the internet is the real lesson. If you're information is online it's there forever. Be careful. Don't get worried however if you find your email somewhere. If it were really bad, you'd know.
|
||||
\end{enumerate}
|
||||
|
||||
\end{document}
|
||||
|
||||
% Possibly Important LaTeX Functions %
|
||||
% ================================== %
|
||||
|
||||
% \begin{figure}[hbtp]
|
||||
% \centering
|
||||
% \fbox{\includegraphics[width=13.8cm]{big_o.png}}
|
||||
% \caption{Big(O) Notation}
|
||||
% \end{figure}
|
||||
|
||||
% \begin{lstlisting}[language=Python]
|
||||
% print('hello world')
|
||||
% \end{lstlisting}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
\documentclass[12pt]{article}
|
||||
\usepackage[a4paper, total={6in, 10in}]{geometry}
|
||||
|
||||
\usepackage{graphicx}
|
||||
\usepackage{abstract}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{listings}
|
||||
\usepackage{indentfirst}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{titling}
|
||||
\usepackage{mwe}
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{setspace}
|
||||
|
||||
\graphicspath{ {./images/} }
|
||||
\onehalfspacing
|
||||
|
||||
\setlength{\parskip}{3mm} % Add space between paragraphs.
|
||||
\setlength{\parindent}{0.5in}
|
||||
\setlength{\droptitle}{-35pt}
|
||||
|
||||
\fancypagestyle{plain}{
|
||||
\vspace{3ex}
|
||||
\fancyhead[L]{November 14th, 2020}
|
||||
\renewcommand{\headrulewidth}{0.5pt}
|
||||
}
|
||||
|
||||
\pretitle{\begin{center} \LARGE \textbf}
|
||||
\posttitle{\end{center} \vspace{-3ex}}
|
||||
\preauthor{\begin{center} \large}
|
||||
\postauthor{\end{center} \vspace{-3ex}}
|
||||
\predate{\begin{center} \small \emph}
|
||||
\postdate{\end{center} \vspace{-3ex}}
|
||||
|
||||
\title{Chapter 6 Summary \& Review Questions}
|
||||
\author{Chris Nutter\thanks{Dedicated to @QuesoGrande a.k.a. Jared D.}}
|
||||
\date{CPSC 315}
|
||||
|
||||
% --> Here we go, satellite radio, y'all get hit with a...
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
|
||||
%\begin{center} \vspace{-4ex}|\vspace{-3ex} \end{center}
|
||||
\normalsize
|
||||
|
||||
\tableofcontents
|
||||
\vspace{4ex}
|
||||
|
||||
\begin{center} Content begins on next page. \end{center}
|
||||
|
||||
\newpage
|
||||
\doublespacing
|
||||
% --> First Chapter
|
||||
|
||||
\section{Chapter 6 Summary}
|
||||
\indent Cyber Security is very important to maintaining and preserving our information. The government is in place to protect and serve its citizens to the best of their ability. However the government also makes a living off of its people and will tend to put policies in place to keep citizens in order. This is where governments will try to obtain information on people in order to "protect" other people. Government systems on all level have their benefits and disadvantages. The federal government is in charge of all states and puts nationwide policies into effect while the state government governs just the people within each state. Why this is important is due to how cyber security practices go per state.\\
|
||||
\indent Personally the federal government shouldn't have a lot of power because this allows too much constriction to rules. If a policy is put into place in a state and I don't agree with it, I can branch away from that state while federal policies are nationwide. Security practices that are federally run ted to be very unsafe towards the community. Acts like the Patriot Act that allows surveillance to be done in order to protect foreign attacks. While the meaning is good, the execution is very unsafe towards its citizens.\\
|
||||
\indent 9/11 was a major hit towards the United States and it brought on this new idea of are we really safe. Physically and technology-wise. Many federal agencies were caught illegally obtaining information in order to better "understand 9/11 and why it happened." (This is not a direct quote but more of an exaggeration of what I presume their intentions were)
|
||||
\newpage
|
||||
\onehalfspacing
|
||||
|
||||
\section{Review Questions}
|
||||
\begin{enumerate}
|
||||
\item Privacy is considered by these men to be a human right. They all each have very similar ideas of everyone else and yourself. Privacy being how much everyone knows about me.
|
||||
\item Wiretapping was a felony case in 1879 but was used by the NYC police until 1920. After World War II, FBI director J. Edgar Hoover pressed to have the ban on wiretapping withdrawn. The NSA were also caught wiretapping after 9/11 trying to obtain information about al-Qaeda.
|
||||
\item COPPA is a huge benefit for children as it protects children online who aren't old enough to understand. California's Reader Privacy Act was passed in 2011 which prohibits commercial provider of book service to disclose information from subjects. Health Information Technology for Economic and Clinical Health Act protects patients from unwanted information to be sold about medical records.
|
||||
\item The US Census is important as it gives our government a way to understand how things should be put into effect. Voting is a huge achievement as it allows our country to speak about who they want in charge.
|
||||
\item Three examples of government agencies illegally obtaining information is NSA wiretapping phones post-9/11, the NYC police wiretapping even after being placed as a felony.
|
||||
\item Telephony metadata is the collection of cellphone records done by the government as a way to keep tabs on its citizens post-9/11. Once the NSA were caught obtaining information, people were not happy to learn about the government spying on them.
|
||||
\item All operations involved the tampering and wiretapping of information from third-parties. Not all these were successful however as some were done illegally (i.e NSA wiretapping).
|
||||
\item They let their ISP handle their emails but they're also able to investigate the email as well giving them control over your information which could be done in bad practice.
|
||||
\item The use of National Security Letters can raise privacy concerns as it gives the government a way to spy on its citizens.
|
||||
\item The five tenets are:
|
||||
\begin{enumerate}
|
||||
\item No secret information.
|
||||
\item Citizens must know what information they are storing.
|
||||
\item People can opt-out of information if they choose to.
|
||||
\item People can change any errors written.
|
||||
\item Make sure the information is secure.
|
||||
\end{enumerate}
|
||||
\item The Privacy Act didn't particularly help anything as it just allowed the government to keep the tabs on people not the organizations.
|
||||
\item Only certain information is kept for a certain amount of time. Which can allow companies to make judgements.
|
||||
\item The government can collect our information like medical records for example and use that to send us ads for government-based healthcare plans, different tax brackets, or even avoid us from being able to do things other people can (i.e driving a car).
|
||||
\item You only have one social security number linked to a person so it shouldn't be used everyone and for everything.
|
||||
\item National identification card allows people to distinguish who they are and it also lets people use something that isn't hugely private. The problem however is this ID can be stolen or worse even used against you in identity fraud.
|
||||
\item The government has mandated how companies can collect information especially websites requiring user verification. The government has helped the illegal use of your information by making it required where your information is used. The government has made it a felony to invade people's privacy and illegally obtain their information.
|
||||
\end{enumerate}
|
||||
|
||||
\end{document}
|
||||
|
||||
% Possibly Important LaTeX Functions %
|
||||
% ================================== %
|
||||
|
||||
% \begin{figure}[hbtp]
|
||||
% \centering
|
||||
% \fbox{\includegraphics[width=13.8cm]{big_o.png}}
|
||||
% \caption{Big(O) Notation}
|
||||
% \end{figure}
|
||||
|
||||
% \begin{lstlisting}[language=Python]
|
||||
% print('hello world')
|
||||
% \end{lstlisting}
|
||||
|
||||
|
After Width: | Height: | Size: 379 KiB |
|
After Width: | Height: | Size: 298 KiB |
|
After Width: | Height: | Size: 260 KiB |
|
After Width: | Height: | Size: 238 KiB |
|
After Width: | Height: | Size: 629 KiB |
|
After Width: | Height: | Size: 259 KiB |
|
After Width: | Height: | Size: 213 KiB |
|
After Width: | Height: | Size: 267 KiB |
|
After Width: | Height: | Size: 195 KiB |
|
After Width: | Height: | Size: 201 KiB |
@@ -0,0 +1,83 @@
|
||||
\documentclass[12pt,a4paper]{article}
|
||||
|
||||
\usepackage{graphicx}
|
||||
\usepackage{abstract}
|
||||
\usepackage{hyperref}
|
||||
|
||||
\graphicspath{ {./images/} }
|
||||
\renewcommand{\abstractname}{Timestamps}
|
||||
\renewcommand{\absleftindent}{}
|
||||
\renewcommand{\absparindent}{}
|
||||
|
||||
\title{CPSC 362 Lecture - poof}
|
||||
\author{Chris Nutter\thanks{Dedicated to @QuesoGrande}}
|
||||
|
||||
% --> Kachow
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
|
||||
\begin{abstract}
|
||||
{07:38:48 PM}\\
|
||||
Okay so he's talking mainly about the project and how far along people are.
|
||||
People tend to not be incredibly far only a handful of people have created an FSM.
|
||||
He said he is considering adjusting the project depending on our
|
||||
position and understanding of the project.
|
||||
\\\\
|
||||
07:48:16 PM\\
|
||||
Now he is going back to talking about how to implement a DFSM into code.
|
||||
He's sorta doing psuedo-code mentioned below. \emph{Figure 4}
|
||||
\\\\
|
||||
08:06:36 PM\\
|
||||
Taking a break then going to go over non-deterministic FSM (and NFAs).
|
||||
\\\\
|
||||
08:13:54 PM\\
|
||||
You can get 90\% on the project if you document a FSM and diagram it without code. FYI.
|
||||
Basically 90\% for desired output, 100\% for intended FSM.
|
||||
\\\\
|
||||
08:48:38 PM\\
|
||||
Basically he's been making corrolations between video game idles and NFSM. He also mentioned
|
||||
that this will be useful for regexp next week.
|
||||
\\\\
|
||||
09:11:51 PM\\
|
||||
Next time, we are converting NFSM to DFSM. So make sure to understand FSM. lol
|
||||
\end{abstract}
|
||||
|
||||
\clearpage
|
||||
\tableofcontents
|
||||
\clearpage
|
||||
|
||||
\section{FSM Recap}
|
||||
A finite-state machine (FSM) or finite-state automaton (FSA, plural: automata),
|
||||
finite automaton, or simply a state machine, is a mathematical model of computation.
|
||||
It is an abstract machine that can be in exactly one of a finite number of states at
|
||||
any given time. The FSM can change from one state to another in response to some inputs;
|
||||
the change from one state to another is called a transition.\\\\
|
||||
[1] An FSM is defined by a list of its states, its initial state, and the inputs that trigger each transition.
|
||||
Finite-state machines are of two types—deterministic finite-state machines and non-deterministic finite-state machines.\\\\
|
||||
A deterministic finite-state machine can be constructed equivalent to any non-deterministic one.
|
||||
\\\\
|
||||
\begin{center}\fbox{\includegraphics[width=13cm]{fsm.png}}\end{center}
|
||||
|
||||
\section{Chapter 2.2 - Deterministic FSM}
|
||||
\fbox{\includegraphics[width=14cm]{example-fsm-problem.png}}
|
||||
\\\\
|
||||
\fbox{\includegraphics[width=14cm]{implementation-of-dfsm.png}}
|
||||
\\\\
|
||||
\fbox{\includegraphics[width=14cm]{implementation-dfsm-w-code.png}}
|
||||
|
||||
\begin{center}\line(1,0){250}\end{center}
|
||||
|
||||
\section{Chapter 2.3 - Non-Deterministic FSM (NFSM)}
|
||||
\fbox{\includegraphics[width=14cm]{nfsm.png}}
|
||||
\\\\
|
||||
\fbox{\includegraphics[width=14cm]{ex1-nfsm.png}}
|
||||
\\\\
|
||||
\fbox{\includegraphics[width=14cm]{nfsm-epsilon.png}}
|
||||
\\\\
|
||||
\fbox{\includegraphics[width=14cm]{ex2-nfsm.png}}
|
||||
|
||||
\clearpage
|
||||
|
||||
\end{document}
|
||||
@@ -0,0 +1,63 @@
|
||||
\documentclass[12pt,a4paper]{article}
|
||||
|
||||
\usepackage{graphicx}
|
||||
\usepackage{abstract}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{listings}
|
||||
%\usepackage{indentfirst} % Can be finicky. Use primarily for homework.
|
||||
\usepackage{amssymb}
|
||||
|
||||
\graphicspath{ {./images/} }
|
||||
\renewcommand{\abstractname}{\large{Timestamps}}
|
||||
|
||||
\setlength{\parindent}{0.5in}
|
||||
|
||||
\title{CPSC 323 - Lecture}
|
||||
\author{Chris Nutter\thanks{Dedicated to @QuesoGrande a.k.a. Jared D.}}
|
||||
|
||||
% --> Here we go, satellite radio, y'all get hit with a...
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
|
||||
\begin{abstract}
|
||||
\noindent
|
||||
\begin{center}\textbf{09/17/2020 - 07:02:20 PM}\end{center}
|
||||
Make sure to submit project by 09-29-2020 by \textbf{ALL} group members.
|
||||
|
||||
\end{abstract}
|
||||
|
||||
% --> First Chapter
|
||||
|
||||
\section{Lecture}
|
||||
\begin{figure}[!htb]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.5cm]{nfa-dfa.png}}
|
||||
\caption{NFA to DFA Conversion}
|
||||
\end{figure}
|
||||
\begin{figure}[!htb]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.5cm]{dfsm-difference.png}}
|
||||
\caption{DFSM Differences}
|
||||
\end{figure}
|
||||
|
||||
|
||||
|
||||
% --> Next Chapter
|
||||
|
||||
\end{document}
|
||||
|
||||
% Possibly Important LaTeX Functions %
|
||||
% ================================== %
|
||||
|
||||
% \begin{figure}[!htb]
|
||||
% \centering
|
||||
% \fbox{\includegraphics[width=13.8cm]{big_o.png}}
|
||||
% \caption{Big(O) Notation}
|
||||
% \end{figure}
|
||||
|
||||
% \begin{lstlisting}[language=Python]
|
||||
% print('hello world')
|
||||
% \end{lstlisting}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
\documentclass[12pt,a4paper]{article}
|
||||
|
||||
\usepackage{hyperref}
|
||||
\usepackage{listings}
|
||||
|
||||
\renewcommand{\baselinestretch}{1.4}
|
||||
|
||||
\hypersetup {
|
||||
colorlinks=true,
|
||||
linkcolor=blue,
|
||||
filecolor=magenta,
|
||||
urlcolor=blue,
|
||||
}
|
||||
|
||||
% --> Here we go, satellite radio, y'all get hit with a...
|
||||
|
||||
\begin{document}
|
||||
\obeylines
|
||||
|
||||
\begin{center}
|
||||
\LARGE\textbf{\\Project \#1 | Lexical Analysis\\\large(Extra Credit)\\}
|
||||
\end{center}
|
||||
\normalsize
|
||||
|
||||
\noindent \\My Name: \textbf{Chris Nutter}
|
||||
\noindent My Email: \textbf{cdnutter@csu.fullerton.edu}
|
||||
\noindent My CWID: \textbf{893272518}
|
||||
\noindent My Teammate: \textbf{Jared Dyreson}
|
||||
\begin{center}\line(1,0){250}\end{center}
|
||||
|
||||
\noindent I have provided the current iteration of our GitHub project located \href{https://github.com/JaredDyreson/Diablo/tree/devbranch/lexical_analysis}{here} and also as a zip file attached to the upload. If you have any questions regarding this email me at the email above.
|
||||
|
||||
\end{document}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <cmath>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <regex>
|
||||
#include <vector>
|
||||
#include <tuple>
|
||||
|
||||
void processLine();
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
processLine();
|
||||
}
|
||||
|
||||
void processLine() {
|
||||
const std::regex r("(!([^!]|!!)*!)");
|
||||
std::smatch sm;
|
||||
std::string id = "! Hello ! int value = 0;";
|
||||
|
||||
std::vector<std::tuple<int, int>> collection;
|
||||
|
||||
if (std::regex_search(id, sm, r)) {
|
||||
for (unsigned long int i=1; i<sm.size()-1; i++) {
|
||||
std::cout << id << std::endl;
|
||||
unsigned long int start = sm.position(i);
|
||||
unsigned long int end = start + sm.length(i);
|
||||
|
||||
//std::cout << "start: " << start << " end: " << end << std::endl << std::endl;
|
||||
collection.push_back(std::make_tuple(start, end));
|
||||
|
||||
for (auto element : collection) {
|
||||
auto [x, y] = element;
|
||||
if (x < end || y < start) { std::cout << "nice" << std::endl; }
|
||||
else { std::cout << "BAD" << std::endl; }
|
||||
std::cout << x << " " << y << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 416 KiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 748 KiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 857 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 986 KiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 891 KiB |
|
After Width: | Height: | Size: 544 KiB |
|
After Width: | Height: | Size: 1009 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 483 KiB |
@@ -0,0 +1,98 @@
|
||||
\documentclass[12pt,a4paper]{article}
|
||||
|
||||
\usepackage{graphicx}
|
||||
\usepackage{abstract}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{listings}
|
||||
\usepackage{amssymb}
|
||||
%\usepackage{indentfirst}
|
||||
|
||||
\graphicspath{ {./images/} }
|
||||
\renewcommand{\abstractname}{\large{Timestamps}}
|
||||
|
||||
\setlength{\parindent}{0.5in}
|
||||
|
||||
\title{CPSC 335 | Lecture \#3}
|
||||
\author{Chris Nutter\thanks{Dedicated to @QuesoGrande a.k.a. Jared D.}}
|
||||
|
||||
% --> Here we go, satellite radio, y'all get hit with a...
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
|
||||
\begin{abstract}
|
||||
\noindent
|
||||
\begin{center}\textbf{09/14/2020 - 07:07:56 PM}\end{center}
|
||||
Read Ch. 3. It's about 30 pages. Could be important.\\
|
||||
\begin{center}\textbf{09/14/2020 - 07:44:53 PM}\end{center}
|
||||
Went to bathroom and lost information.\\
|
||||
\begin{center}\textbf{09/14/2020 - 07:44:53 PM}\end{center}
|
||||
Got back and Star said that he finished the problem.\\
|
||||
\begin{center}\textbf{09/14/2020 - 09:08:49 PM}\end{center}
|
||||
Read 3.4 \& 3.5. I mean theoretically read all sections cause \textbf{THE STUFF COULD BE ON THE TEST!!!}\\
|
||||
\end{abstract}
|
||||
|
||||
\tableofcontents
|
||||
|
||||
% -->
|
||||
|
||||
\section{After The Icosian Game}
|
||||
Directed Graph: Graph with directed edge\\\\
|
||||
$2^{20} = 1,000,000\\20! = 45,000,000\\$
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{big_o.png}}
|
||||
\caption{Big(O) Notation}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{big_o-examples.png}}
|
||||
\caption{Big(O) Examples | \textbf{\emph{Important}}}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{big_o-running-time.png}}
|
||||
\caption{Big(O) Running Times}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{recursion-algo.png}}
|
||||
\caption{Recursion Algorithm}
|
||||
\end{figure}
|
||||
|
||||
\section{Chapter 3}
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{bruteforce.png}}
|
||||
\caption{Bruteforce Algorithm}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{gauss-trick.png}}
|
||||
\caption{Gauss's Trick \& Bubble Sort}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{bubble-sort.png}}
|
||||
\caption{More Bubble Sort}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{search+strings.png}}
|
||||
\caption{Search \& Strings}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{exhaustive-search.png}}
|
||||
\caption{Exhaustive Search, \textbf{TSP}: Traveling Salesman Problem}
|
||||
\end{figure}
|
||||
|
||||
\end{document}
|
||||
@@ -0,0 +1,84 @@
|
||||
\documentclass[12pt,a4paper]{article}
|
||||
|
||||
\usepackage{graphicx}
|
||||
\usepackage{abstract}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{listings}
|
||||
%\usepackage{amssymb}
|
||||
%\usepackage{indentfirst}
|
||||
|
||||
\graphicspath{ {./images/} }
|
||||
\renewcommand{\abstractname}{\large{Timestamps}}
|
||||
|
||||
\setlength{\parindent}{0.5in}
|
||||
|
||||
\title{CPSC 335 | Lecture \#4}
|
||||
\author{Chris Nutter\thanks{Dedicated to @QuesoGrande a.k.a. Jared D.}}
|
||||
|
||||
% --> Here we go, satellite radio, y'all get hit with a...
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
|
||||
\begin{abstract}
|
||||
\noindent
|
||||
\begin{center}\textbf{09/21/2020 - 07:27:25 PM}\end{center}
|
||||
\textbf{MIDTERM NEXT WEEK!}\\
|
||||
\end{abstract}
|
||||
|
||||
\tableofcontents
|
||||
|
||||
% -->
|
||||
|
||||
\section{Lecture}
|
||||
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{knapsack.png}}
|
||||
\caption{Knapsack Problem}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{knapsack-cont.png}}
|
||||
\caption{Knapsack Problem (\emph{cont.})}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{o(nd).png}}
|
||||
\caption{$O(N^{D})$}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{triangle-num.png}}
|
||||
\caption{Triangle Numbers Problem}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{dfs3.1.png}}
|
||||
\caption{Depth First Search | Fig. 3.10}
|
||||
\end{figure}
|
||||
|
||||
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{bfs.png}}
|
||||
\caption{Breadth First Search}
|
||||
\end{figure}
|
||||
|
||||
\newpage
|
||||
\section{Review}
|
||||
|
||||
\begin{figure}[!hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{review-1.1.png}}
|
||||
\caption{Review Pt. 1}
|
||||
\end{figure}
|
||||
|
||||
|
||||
|
||||
\end{document}
|
||||
@@ -0,0 +1 @@
|
||||
\relax
|
||||
@@ -0,0 +1,109 @@
|
||||
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/Arch Linux) (preloaded format=latex 2020.9.8) 8 SEP 2020 16:55
|
||||
entering extended mode
|
||||
restricted \write18 enabled.
|
||||
%&-line parsing enabled.
|
||||
**335-02-p1-4head-Standup-200908.tex 335-02-p1-4head-Standup-200908.pdf
|
||||
(./335-02-p1-4head-Standup-200908.tex
|
||||
LaTeX2e <2020-02-02> patch level 5
|
||||
L3 programming layer <2020-06-03>
|
||||
(/usr/share/texmf-dist/tex/latex/base/article.cls
|
||||
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
|
||||
(/usr/share/texmf-dist/tex/latex/base/size12.clo
|
||||
File: size12.clo 2019/12/20 v1.4l Standard LaTeX file (size option)
|
||||
)
|
||||
\c@part=\count167
|
||||
\c@section=\count168
|
||||
\c@subsection=\count169
|
||||
\c@subsubsection=\count170
|
||||
\c@paragraph=\count171
|
||||
\c@subparagraph=\count172
|
||||
\c@figure=\count173
|
||||
\c@table=\count174
|
||||
\abovecaptionskip=\skip47
|
||||
\belowcaptionskip=\skip48
|
||||
\bibindent=\dimen134
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/graphics/graphicx.sty
|
||||
Package: graphicx 2019/11/30 v1.2a Enhanced LaTeX Graphics (DPC,SPQR)
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/graphics/keyval.sty
|
||||
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
|
||||
\KV@toks@=\toks15
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/graphics/graphics.sty
|
||||
Package: graphics 2019/11/30 v1.4a Standard LaTeX Graphics (DPC,SPQR)
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/graphics/trig.sty
|
||||
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
|
||||
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
|
||||
)
|
||||
Package graphics Info: Driver file: dvips.def on input line 105.
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/graphics-def/dvips.def
|
||||
File: dvips.def 2017/06/20 v3.1d Graphics/color driver for dvips
|
||||
))
|
||||
\Gin@req@height=\dimen135
|
||||
\Gin@req@width=\dimen136
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/l3backend/l3backend-dvips.def
|
||||
File: l3backend-dvips.def 2020-06-03 L3 backend support: dvips
|
||||
\l__pdf_internal_box=\box45
|
||||
\g__pdf_backend_object_int=\count175
|
||||
\l__pdf_backend_content_box=\box46
|
||||
\l__pdf_backend_model_box=\box47
|
||||
\g__pdf_backend_annotation_int=\count176
|
||||
\g__pdf_backend_link_int=\count177
|
||||
\g__pdf_backend_link_sf_int=\count178
|
||||
)
|
||||
(./335-02-p1-4head-Standup-200908.aux)
|
||||
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 13.
|
||||
LaTeX Font Info: ... okay on input line 13.
|
||||
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 13.
|
||||
LaTeX Font Info: ... okay on input line 13.
|
||||
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 13.
|
||||
LaTeX Font Info: ... okay on input line 13.
|
||||
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 13.
|
||||
LaTeX Font Info: ... okay on input line 13.
|
||||
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 13.
|
||||
LaTeX Font Info: ... okay on input line 13.
|
||||
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 13.
|
||||
LaTeX Font Info: ... okay on input line 13.
|
||||
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 13.
|
||||
LaTeX Font Info: ... okay on input line 13.
|
||||
LaTeX Font Info: External font `cmex10' loaded for size
|
||||
(Font) <14.4> on input line 15.
|
||||
LaTeX Font Info: External font `cmex10' loaded for size
|
||||
(Font) <7> on input line 15.
|
||||
|
||||
Underfull \hbox (badness 10000) in paragraph at lines 20--29
|
||||
|
||||
[]
|
||||
|
||||
|
||||
Underfull \hbox (badness 10000) in paragraph at lines 20--29
|
||||
|
||||
[]
|
||||
|
||||
|
||||
! LaTeX Error: Cannot determine size of graphic in ../imgs/workforstandup1-chri
|
||||
s.png (no BoundingBox).
|
||||
|
||||
See the LaTeX manual or LaTeX Companion for explanation.
|
||||
Type H <return> for immediate help.
|
||||
...
|
||||
|
||||
l.33 ...hics[width=7cm]{workforstandup1-chris.png}
|
||||
|
||||
? x
|
||||
|
||||
Here is how much of TeX's memory you used:
|
||||
743 strings out of 480479
|
||||
11546 string characters out of 5905986
|
||||
245706 words of memory out of 5000000
|
||||
16825 multiletter control sequences out of 15000+600000
|
||||
534801 words of font info for 32 fonts, out of 8000000 for 9000
|
||||
1141 hyphenation exceptions out of 8191
|
||||
30i,6n,25p,1712b,263s stack positions out of 5000i,500n,10000p,200000b,80000s
|
||||
No pages of output.
|
||||
@@ -0,0 +1,51 @@
|
||||
\documentclass[12pt,a4paper]{article}
|
||||
|
||||
% --> Declare packages / paths
|
||||
\usepackage{graphicx}
|
||||
|
||||
\graphicspath{ {../imgs/} }
|
||||
|
||||
% --> Basic overlaying information
|
||||
\title{Project \#1 - Standup Report \#1}
|
||||
\author{Chris Nutter | Estrella Mejia | Kenneth Doan}
|
||||
|
||||
% --> Begin document information
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
%\tableofcontents
|
||||
|
||||
%------------------------%
|
||||
\section{Chris Nutter}
|
||||
1. Currently I'm working on getting the grid organized and properly formatted towards Professor Siska's recommendations.
|
||||
I have created the grid 41x41 and properly spaced out the grid itself. I have also hosted the P5 grid on my website
|
||||
for our groupmates to look over live.
|
||||
\\\\
|
||||
2. Next I plan to fix a bug where mouse cursor mapping is off but that shouldn't be too hard.
|
||||
\\\\
|
||||
3. I'm still familiarizing with JS and P5 so adjusting to that is an annoying hurdle but it's helpful for
|
||||
me to learn this for my own means. Professor Siska's comments on \emph{cs-sketches.js} help me
|
||||
figure out what each thing does.
|
||||
%------------------------%
|
||||
|
||||
%------------------------%
|
||||
\section{Estrella Mejia}
|
||||
1. I'm working on getting the ant to start at the center.
|
||||
\\\\
|
||||
2. I plan to get the ant to move right on red or blue and left on black or green.
|
||||
\\\\
|
||||
3. I am trying to get the color properly
|
||||
%------------------------%
|
||||
|
||||
%------------------------%
|
||||
\section{Kenneth Doan}
|
||||
1. I am trying to find the decimal color values for Black, Red, Yellow, Blue, and Green.
|
||||
I am also trying to figure out how to turn the ant into a triangle in the meantime.
|
||||
\\\\
|
||||
2. Next I'll learn how to make the Ant start moving North at the start of the load.
|
||||
\\\\
|
||||
3. Implementing the triangle shape and the colours are some challenges
|
||||
I am facing because this is the second class I have taken that is using HTML5.
|
||||
%------------------------%
|
||||
|
||||
\end{document}
|
||||
@@ -0,0 +1,18 @@
|
||||
TP Ant Setup
|
||||
by Charles Siska - Saturday, September 5, 2020, 6:39 PM
|
||||
Number of replies: 0
|
||||
TP Ant Setup
|
||||
1. "Initially, the grid is all black and the Ant is in the center cell,
|
||||
heading North (toward the top)."
|
||||
2. "initialize a 41 by 41 square grid to have all cells black (state 0).
|
||||
The lone Ant should be in the center cell."
|
||||
TP Ant First "Move"
|
||||
3. "it first notices the color of the cell it is on and then changes its
|
||||
direction/heading based on this color,"
|
||||
BEFORE Doing Any Move
|
||||
4. "then 'increments' the color of the cell under it to the next color
|
||||
in sequence"
|
||||
FROM Black to The Next Color
|
||||
5. "finally moves one cell in its new direction"
|
||||
Which Was Set in Step #4, Above.
|
||||
Hope this helps.
|
||||
@@ -0,0 +1,35 @@
|
||||
// Draw stuff, with P5 // CF p5js.org/reference
|
||||
// Time-stamp: <2020-02-02 14:46:00 Chuck Siska>
|
||||
// ------------------------------------------------------------
|
||||
|
||||
// ===================================================== draw_grid ====
|
||||
// Draw a fancy grid with major & minor lines
|
||||
// & major row/col numbers.
|
||||
function draw_grid( rminor, rmajor, rstroke, rfill )
|
||||
{
|
||||
stroke( rstroke );
|
||||
fill( rfill );;
|
||||
let sz = g_canvas.cell_size;
|
||||
let width = g_canvas.wid*sz;
|
||||
let height = g_canvas.hgt*sz
|
||||
for ( var ix = 0; ix < width; ix += rminor )
|
||||
{
|
||||
let big_linep = (ix % rmajor == 0);
|
||||
let line_wgt = 1;
|
||||
if (big_linep) line_wgt = 2;
|
||||
strokeWeight( line_wgt );
|
||||
line( ix, 0, ix, height );
|
||||
strokeWeight( 1 );
|
||||
if ( ix % rmajor == 0 ) { text( ix, ix, 10 ); }
|
||||
}
|
||||
for ( var iy = 0; iy < height; iy += rminor )
|
||||
{
|
||||
let big_linep = (iy % rmajor == 0);
|
||||
let line_wgt = 1;
|
||||
if (big_linep) line_wgt = 2;
|
||||
strokeWeight( line_wgt );
|
||||
line( 0, iy, width, iy );
|
||||
strokeWeight( 1 );
|
||||
if ( iy % rmajor == 0 ) { text( iy, 0, iy + 10 ); }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
body {
|
||||
text-align: center;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
canvas {
|
||||
background-color: black;
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
// cs-sketch.js; P5 key animation fcns. // CF p5js.org/reference
|
||||
// Time-stamp: <2020-02-02 15:58:23 Chuck Siska>
|
||||
|
||||
// Make global g_canvas JS 'object': a key-value 'dictionary'.
|
||||
var g_canvas = { cell_size:25, wid:41, hgt:41 }; // JS Global var, w canvas size info.
|
||||
//var g_canvas = { cell_size:10, wid:64, hgt:48 }; // JS Global var, w canvas size info.
|
||||
var g_frame_cnt = 0; // Setup a P5 display-frame counter, to do anim
|
||||
var g_frame_mod = 24; // Update ever 'mod' frames.
|
||||
var g_stop = 0; // Go by default.
|
||||
|
||||
function setup() // P5 Setup Fcn
|
||||
{
|
||||
let sz = g_canvas.cell_size;
|
||||
let width = sz * g_canvas.wid; // Our 'canvas' uses cells of given size, not 1x1 pixels.
|
||||
let height = sz * g_canvas.hgt;
|
||||
createCanvas( width, height ); // Make a P5 canvas.
|
||||
draw_grid( 25, 41, 'white', 'yellow' );
|
||||
}
|
||||
|
||||
var g_bot = { dir:3, x:20, y:20, color:100 }; // Dir is 0..7 clock, w 0 up.
|
||||
var g_box = { t:1, hgt:47, l:1, wid:63 }; // Box in which bot can move.
|
||||
|
||||
function move_bot( )
|
||||
{
|
||||
let dir = (round (8 * random( ))) // Change direction at random; brownian motion.
|
||||
let dx = 0;
|
||||
let dy = 0;
|
||||
switch (dir) { // Convert dir to x,y deltas: dir = clock w 0=Up,2=Rt,4=Dn,6=Left.
|
||||
case 0 : { dy = -1; break; }
|
||||
case 1 : { dx = 1; dy = -1; break; }
|
||||
case 2 : { dx = 1; break; }
|
||||
case 3 : { dx = 1; dy = 1; break; }
|
||||
case 4 : { dy = 1; break; }
|
||||
case 5 : { dx = -1; dy = 1; break; }
|
||||
case 6 : { dx = -1; break; }
|
||||
case 7 : { dx = -1; dy = -1; break; }
|
||||
}
|
||||
let x = (dx + g_bot.x + g_box.wid) % g_box.wid; // Move-x. Ensure positive b4 mod.
|
||||
let y = (dy + g_bot.y + g_box.hgt) % g_box.hgt; // Ditto y.
|
||||
let color = 100 + (1 + g_bot.color) % 156; // Incr color in nice range.
|
||||
g_bot.x = x; // Update bot x.
|
||||
g_bot.y = y;
|
||||
g_bot.dir = dir;
|
||||
g_bot.color = color;
|
||||
//console.log( "bot x,y,dir,clr = " + x + "," + y + "," + dir + "," + color );
|
||||
}
|
||||
|
||||
function draw_bot( ) // Convert bot pox to grid pos & draw bot.
|
||||
{
|
||||
let sz = g_canvas.cell_size;
|
||||
let sz2 = sz / 2;
|
||||
let x = 1+ g_bot.x*sz; // Set x one pixel inside the sz-by-sz cell.
|
||||
let y = 1+ g_bot.y*sz;
|
||||
let big = sz -2; // Stay inside cell walls.
|
||||
// Fill 'color': its a keystring, or a hexstring like "#5F", etc. See P5 docs.
|
||||
fill( "#" + g_bot.color ); // Concat string, auto-convert the number to string.
|
||||
//console.log( "x,y,big = " + x + "," + y + "," + big );
|
||||
let acolors = get( x + sz2, y + sz2 ); // Get cell interior pixel color [RGBA] array.
|
||||
let pix = acolors[ 0 ] + acolors[ 1 ] + acolors[ 2 ];
|
||||
//console.log( "acolors,pix = " + acolors + ", " + pix );
|
||||
|
||||
// (*) Here is how to detect what's at the pixel location. See P5 docs for fancier...
|
||||
if (0 != pix) { fill( 0 ); stroke( 0 ); } // Turn off color of prior bot-visited cell.
|
||||
else { stroke( 'white' ); } // Else Bot visiting this cell, so color it.
|
||||
|
||||
// Paint the cell.
|
||||
rect( x, y, big, big );
|
||||
}
|
||||
|
||||
function draw_update() // Update our display.
|
||||
{
|
||||
//console.log( "g_frame_cnt = " + g_frame_cnt );
|
||||
move_bot( );
|
||||
draw_bot( );
|
||||
}
|
||||
|
||||
function draw() // P5 Frame Re-draw Fcn, Called for Every Frame.
|
||||
{
|
||||
++g_frame_cnt;
|
||||
if (0 == g_frame_cnt % g_frame_mod)
|
||||
{
|
||||
if (!g_stop) draw_update();
|
||||
}
|
||||
}
|
||||
|
||||
function keyPressed( )
|
||||
{
|
||||
g_stop = ! g_stop;
|
||||
}
|
||||
|
||||
function mousePressed( )
|
||||
{
|
||||
let x = mouseX;
|
||||
let y = mouseY;
|
||||
//console.log( "mouse x,y = " + x + "," + y );
|
||||
let sz = g_canvas.cell_size;
|
||||
let gridx = round( (x-0.5) / sz );
|
||||
let gridy = round( (y-0.5) / sz );
|
||||
//console.log( "grid x,y = " + gridx + "," + gridy );
|
||||
//console.log( "box wid,hgt = " + g_box.wid + "," + g_box.hgt );
|
||||
g_bot.x = gridx + g_box.wid; // Ensure its positive.
|
||||
//console.log( "bot x = " + g_bot.x );
|
||||
g_bot.x %= g_box.wid; // Wrap to fit box.
|
||||
g_bot.y = gridy + g_box.hgt;
|
||||
//console.log( "bot y = " + g_bot.y );
|
||||
g_bot.y %= g_box.hgt;
|
||||
//console.log( "bot x,y = " + g_bot.x + "," + g_bot.y );
|
||||
draw_bot( );
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
// cs-sketch.js; P5 key animation fcns. // CF p5js.org/reference
|
||||
// Time-stamp: <2020-02-02 15:58:23 Chuck Siska>
|
||||
|
||||
// Make global g_canvas JS 'object': a key-value 'dictionary'.
|
||||
|
||||
/*
|
||||
|
||||
Documentation marks are as followed.
|
||||
|
||||
1. Chris Nutter
|
||||
2. Estrella Mejia
|
||||
3. Kenneth Doan
|
||||
|
||||
Group Name: 4head
|
||||
|
||||
*/
|
||||
|
||||
//==============================//
|
||||
// 1. I increased the size of cell_size for easily legibility on high-dpi displays
|
||||
// 09/06/2020 01:20:02 PM
|
||||
//
|
||||
// !! BUG FOUND !! - Mouse input is skewed. Needs fixing.
|
||||
//==============================//
|
||||
|
||||
var g_canvas = { cell_size:20, wid:41, hgt:41 }; // JS Global var, w canvas size info.
|
||||
|
||||
//==============================//
|
||||
// 1. cell_size of 20 is a good size for 1440p displays, might be oversized for 1080p
|
||||
// 09/07/2020 - 05:30:52 PM
|
||||
//==============================//
|
||||
|
||||
var g_frame_cnt = 0; // Setup a P5 display-frame counter, to do anim
|
||||
var g_frame_mod = 24; // Update ever 'mod' frames.
|
||||
var g_stop = 0; // Go by default.
|
||||
|
||||
function setup() // P5 Setup Fcn
|
||||
{
|
||||
let sz = g_canvas.cell_size;
|
||||
let width = sz * g_canvas.wid; // Our 'canvas' uses cells of given size, not 1x1 pixels.
|
||||
let height = sz * g_canvas.hgt;
|
||||
|
||||
createCanvas( width, height ); // Make a P5 canvas.
|
||||
|
||||
//==============================//
|
||||
// 1. Modifying the first and second variable allows for the grid to be matched to proper canvas size.
|
||||
// 09/08/2020 - 07:15:16 PM
|
||||
//==============================//
|
||||
|
||||
draw_grid( 20, 41, 'white', 'yellow' );
|
||||
|
||||
}
|
||||
|
||||
var g_bot = { dir:3, x:20, y:20, color:100 }; // Dir is 0..7 clock, w 0 up.
|
||||
var g_box = { t:1, hgt:47, l:1, wid:63 }; // Box in which bot can move.
|
||||
|
||||
//==============================//
|
||||
// 1. Kenneth's code will be below here and will be really good I bet.
|
||||
// 09/08/2020 - 07:38:44 PM
|
||||
//==============================//
|
||||
|
||||
function move_bot( )
|
||||
{
|
||||
let dir = (round (8 * random( ))) // Change direction at random; brownian motion.
|
||||
let dx = 0;
|
||||
let dy = 0;
|
||||
switch (dir) { // Convert dir to x,y deltas: dir = clock w 0=Up,2=Rt,4=Dn,6=Left.
|
||||
case 0 : { dy = -1; break; }
|
||||
case 1 : { dx = 1; dy = -1; break; }
|
||||
case 2 : { dx = 1; break; }
|
||||
case 3 : { dx = 1; dy = 1; break; }
|
||||
case 4 : { dy = 1; break; }
|
||||
case 5 : { dx = -1; dy = 1; break; }
|
||||
case 6 : { dx = -1; break; }
|
||||
case 7 : { dx = -1; dy = -1; break; }
|
||||
}
|
||||
let x = (dx + g_bot.x + g_box.wid) % g_box.wid; // Move-x. Ensure positive b4 mod.
|
||||
let y = (dy + g_bot.y + g_box.hgt) % g_box.hgt; // Ditto y.
|
||||
let color = 100 + (1 + g_bot.color) % 156; // Incr color in nice range.
|
||||
g_bot.x = x; // Update bot x.
|
||||
g_bot.y = y;
|
||||
g_bot.dir = dir;
|
||||
g_bot.color = color;
|
||||
//console.log( "bot x,y,dir,clr = " + x + "," + y + "," + dir + "," + color );
|
||||
}
|
||||
|
||||
function draw_bot( ) // Convert bot pox to grid pos & draw bot.
|
||||
{
|
||||
let sz = g_canvas.cell_size;
|
||||
let sz2 = sz / 2;
|
||||
let x = 1+ g_bot.x*sz; // Set x one pixel inside the sz-by-sz cell.
|
||||
let y = 1+ g_bot.y*sz;
|
||||
let big = sz -2; // Stay inside cell walls.
|
||||
// Fill 'color': its a keystring, or a hexstring like "#5F", etc. See P5 docs.
|
||||
fill( "#" + g_bot.color ); // Concat string, auto-convert the number to string.
|
||||
//console.log( "x,y,big = " + x + "," + y + "," + big );
|
||||
let acolors = get( x + sz2, y + sz2 ); // Get cell interior pixel color [RGBA] array.
|
||||
let pix = acolors[ 0 ] + acolors[ 1 ] + acolors[ 2 ];
|
||||
//console.log( "acolors,pix = " + acolors + ", " + pix );
|
||||
|
||||
// (*) Here is how to detect what's at the pixel location. See P5 docs for fancier...
|
||||
if (0 != pix) { fill( 0 ); stroke( 0 ); } // Turn off color of prior bot-visited cell.
|
||||
else { stroke( 'white' ); } // Else Bot visiting this cell, so color it.
|
||||
|
||||
// Paint the cell.
|
||||
rect( x, y, big, big );
|
||||
}
|
||||
|
||||
function draw_update() // Update our display.
|
||||
{
|
||||
//console.log( "g_frame_cnt = " + g_frame_cnt );
|
||||
move_bot( );
|
||||
draw_bot( );
|
||||
}
|
||||
|
||||
function draw() // P5 Frame Re-draw Fcn, Called for Every Frame.
|
||||
{
|
||||
++g_frame_cnt;
|
||||
if (0 == g_frame_cnt % g_frame_mod)
|
||||
{
|
||||
if (!g_stop) draw_update();
|
||||
}
|
||||
}
|
||||
|
||||
function keyPressed( )
|
||||
{
|
||||
g_stop = ! g_stop;
|
||||
}
|
||||
|
||||
function mousePressed( )
|
||||
{
|
||||
let x = mouseX;
|
||||
let y = mouseY;
|
||||
//console.log( "mouse x,y = " + x + "," + y );
|
||||
let sz = g_canvas.cell_size;
|
||||
let gridx = round( (x-0.5) / sz );
|
||||
let gridy = round( (y-0.5) / sz );
|
||||
//console.log( "grid x,y = " + gridx + "," + gridy );
|
||||
//console.log( "box wid,hgt = " + g_box.wid + "," + g_box.hgt );
|
||||
g_bot.x = gridx + g_box.wid; // Ensure its positive.
|
||||
//console.log( "bot x = " + g_bot.x );
|
||||
g_bot.x %= g_box.wid; // Wrap to fit box.
|
||||
g_bot.y = gridy + g_box.hgt;
|
||||
//console.log( "bot y = " + g_bot.y );
|
||||
g_bot.y %= g_box.hgt;
|
||||
//console.log( "bot x,y = " + g_bot.x + "," + g_bot.y );
|
||||
draw_bot( );
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html> <!-- this is a JS comment --> <!-- -->
|
||||
<html lang=""> <!-- HTML page begs/ends w 'html' tag -->
|
||||
<head> <!-- HTML page has 'head'section and 'body' section -->
|
||||
<meta foo="Time-stamp: <2020-02-02 17:14:59 Chuck Siska>">
|
||||
<!-- a JS comment.-->
|
||||
<!--
|
||||
Some code, mod'd, from "Introducing JavaScript Game Development" by Stuart.
|
||||
-->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>P5-JS-HTML</title> <!-- Browser or tab title -->
|
||||
<link rel="stylesheet" href="assets/styles.css"> <!-- Tiny CSS style file -->
|
||||
<style> body {padding: 0; margin: 0;} </style> <!-- Bit of in-line CSS -->
|
||||
<script src="p5.js"></script> <!-- Load P5.JS, one file -->
|
||||
<!-- For more P5.JS, CF https://github.com/processing/p5.js/wiki -->
|
||||
<script src="cs-sketch.js"></script> <!-- Load my setup+draw P5-req'd fcns -->
|
||||
</head>
|
||||
<body> <!-- HTML page body, where raw text gets displayed on the page -->
|
||||
<h1>Playing the HTML canvas w P5</h1> <!-- Text in a high priority heading -->
|
||||
<!--
|
||||
<canvas id="cs-canvas" width="400" height="400"></canvas>
|
||||
-->
|
||||
<p> <!-- A paragraph 'break', to start a new paragraph -->
|
||||
Now is the time for all good squid to come to the aid of their waters.
|
||||
</body> <!-- HTML display page ends here -->
|
||||
<script src="assets/draw-stuff.js"></script> <!-- Load some JS fcns in a file -->
|
||||
<!-- <script src="../assets/tools.js"></script> Load more JS fcns -->
|
||||
<script> <!-- And run some JS code if needed; but better in sketch.js. -->
|
||||
|
||||
</script>
|
||||
</html>
|
||||
<!-- F12 on keyboard opens Console+Inspector+Debugger window on most Browsers. -->
|
||||
<!-- F12 Debugger window > Watch+Breakpoint pane > 2-vertical-bars icon stops anim. -->
|
||||
<!-- In JS, outputting alert/message popup, also pauses anim (with your msg). -->
|
||||
<!-- In JS, outputting pgm state info to console can help w debugging. -->
|
||||
<!-- Add a P5 keyPressed( ) fcn to toggle a Stop global var if you like. -->
|
||||
|
After Width: | Height: | Size: 146 KiB |
|
After Width: | Height: | Size: 172 KiB |
@@ -0,0 +1,80 @@
|
||||
Readme for js-p5-example
|
||||
Time-stamp: <2020-09-02 14:11:19 Chuck Siska>
|
||||
------------------------------------------------------------
|
||||
|
||||
Intro
|
||||
|
||||
This example draws a grid and runs an invisible bot from cell to cell
|
||||
on the grid changing its colors. You can stop/restart the bot with
|
||||
any keypress. You can move the bot to any cell with a mouse-click.
|
||||
|
||||
This is an example project using HTML, Javascript (JS), and P5.js
|
||||
which is a JS-adapted version of the Processing Language. CF HTML and
|
||||
JS on the web (eg, Wikipedia). More on P5 is at
|
||||
p5js.org/reference.and at github.com/processing/p5.js/wiki.
|
||||
|
||||
P5 provides sutomated animation (via a user-built "draw" function),
|
||||
and GUI manipulation functions that are simpler than JS.
|
||||
|
||||
Zip Contents
|
||||
|
||||
File readme.txt. This file.
|
||||
|
||||
File pix-js-p5-example-1.JPG. A snapshot of the example webpage.
|
||||
|
||||
File pix-js-p5-example2-F12-Console.JPG A webpage + F12 Console.
|
||||
Shows entering some global var names to see their current values.
|
||||
|
||||
File index-js-p5-example.html. Drag and drop this into a browser to
|
||||
run the example.
|
||||
Click to set new loc for drunk-bot (via mousePressed).
|
||||
Hit (almost) any key to toggle bot on or off (via keyPressed).
|
||||
|
||||
File p5.js. This is the P5 package. It is loaded inside the html.
|
||||
|
||||
File cs-sketch.js; This contains several P5 user-defined linkage functions
|
||||
(setup, draw, keyPressed, and mousePressed), as well as example
|
||||
support functions. P5's setup() is run once before page display.
|
||||
P5's draw() is run once per display frame, so you can do animation.
|
||||
|
||||
File assets/styles.css. This is an extra-small example of controlling
|
||||
webpage styling. // Loaded inside the html.
|
||||
|
||||
File assets/draw-stuff.js. This is an example to show loading a JS
|
||||
script file from a folder other than the index HTML file's
|
||||
folder location. It also includes the utility draw_grid function
|
||||
written in P5+JS. // Loaded inside the html.
|
||||
|
||||
Installation & Running
|
||||
|
||||
1. Extract the .zip file into a folder.
|
||||
|
||||
2. Drag the index HTML file, index-js-p5-example.html, into a browser
|
||||
window. The example P5 program should start immediately. You
|
||||
should see a 640x480 grid (white lines on black background) with
|
||||
row/column headers and some of the grid cells colored. See the
|
||||
picture pix-js-p5-example-1.JPG.
|
||||
|
||||
Known Bugs
|
||||
|
||||
o- Bot cell drawing over-writes a pixels-worth of the cell's grid lines.
|
||||
|
||||
Warnings
|
||||
|
||||
o- Clicking outside the grid wraps the mouse x.y back into the grid --
|
||||
maybe at a weird-looking spot. Enjoy.
|
||||
|
||||
o- Testing was light. Didn't try all key or mouse combos.
|
||||
|
||||
Testing
|
||||
|
||||
o- Following installation instruction, above, watched it run, and
|
||||
tryed a few keypresses and mouse clicks. Looks okay to ship.
|
||||
|
||||
Credits
|
||||
|
||||
Some code was borrowed and modified from Stuart's book.
|
||||
Introducing JavaScript Game Development: Build a 2D Game from the
|
||||
Ground Up, by Graeme Stuart, 2018, 209 pages.
|
||||
|
||||
And, of course, thanks to the HTML and P5.js developers.
|
||||
|
After Width: | Height: | Size: 524 KiB |
|
After Width: | Height: | Size: 41 KiB |
@@ -0,0 +1,35 @@
|
||||
// Draw stuff, with P5 // CF p5js.org/reference
|
||||
// Time-stamp: <2020-02-02 14:46:00 Chuck Siska>
|
||||
// ------------------------------------------------------------
|
||||
|
||||
// ===================================================== draw_grid ====
|
||||
// Draw a fancy grid with major & minor lines
|
||||
// & major row/col numbers.
|
||||
function draw_grid( rminor, rmajor, rstroke, rfill )
|
||||
{
|
||||
stroke( rstroke );
|
||||
fill( rfill );;
|
||||
let sz = g_canvas.cell_size;
|
||||
let width = g_canvas.wid*sz;
|
||||
let height = g_canvas.hgt*sz
|
||||
for ( var ix = 0; ix < width; ix += rminor )
|
||||
{
|
||||
let big_linep = (ix % rmajor == 0);
|
||||
let line_wgt = 1;
|
||||
if (big_linep) line_wgt = 2;
|
||||
strokeWeight( line_wgt );
|
||||
line( ix, 0, ix, height );
|
||||
strokeWeight( 1 );
|
||||
if ( ix % rmajor == 0 ) { text( ix, ix, 10 ); }
|
||||
}
|
||||
for ( var iy = 0; iy < height; iy += rminor )
|
||||
{
|
||||
let big_linep = (iy % rmajor == 0);
|
||||
let line_wgt = 1;
|
||||
if (big_linep) line_wgt = 2;
|
||||
strokeWeight( line_wgt );
|
||||
line( 0, iy, width, iy );
|
||||
strokeWeight( 1 );
|
||||
if ( iy % rmajor == 0 ) { text( iy, 0, iy + 10 ); }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
body {
|
||||
text-align: center;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
canvas {
|
||||
background-color: black;
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
// cs-sketch.js; P5 key animation fcns. // CF p5js.org/reference
|
||||
// Time-stamp: <2020-02-02 15:58:23 Chuck Siska>
|
||||
|
||||
// Make global g_canvas JS 'object': a key-value 'dictionary'.
|
||||
var g_canvas = { cell_size:10, wid:64, hgt:48 }; // JS Global var, w canvas size info.
|
||||
var g_frame_cnt = 0; // Setup a P5 display-frame counter, to do anim
|
||||
var g_frame_mod = 24; // Update ever 'mod' frames.
|
||||
var g_stop = 0; // Go by default.
|
||||
|
||||
function setup() // P5 Setup Fcn
|
||||
{
|
||||
let sz = g_canvas.cell_size;
|
||||
let width = sz * g_canvas.wid; // Our 'canvas' uses cells of given size, not 1x1 pixels.
|
||||
let height = sz * g_canvas.hgt;
|
||||
createCanvas( width, height ); // Make a P5 canvas.
|
||||
draw_grid( 10, 50, 'white', 'yellow' );
|
||||
}
|
||||
|
||||
var g_bot = { dir:3, x:20, y:20, color:100 }; // Dir is 0..7 clock, w 0 up.
|
||||
var g_box = { t:1, hgt:47, l:1, wid:63 }; // Box in which bot can move.
|
||||
|
||||
function move_bot( )
|
||||
{
|
||||
let dir = (round (8 * random( ))) // Change direction at random; brownian motion.
|
||||
let dx = 0;
|
||||
let dy = 0;
|
||||
switch (dir) { // Convert dir to x,y deltas: dir = clock w 0=Up,2=Rt,4=Dn,6=Left.
|
||||
case 0 : { dy = -1; break; }
|
||||
case 1 : { dx = 1; dy = -1; break; }
|
||||
case 2 : { dx = 1; break; }
|
||||
case 3 : { dx = 1; dy = 1; break; }
|
||||
case 4 : { dy = 1; break; }
|
||||
case 5 : { dx = -1; dy = 1; break; }
|
||||
case 6 : { dx = -1; break; }
|
||||
case 7 : { dx = -1; dy = -1; break; }
|
||||
}
|
||||
let x = (dx + g_bot.x + g_box.wid) % g_box.wid; // Move-x. Ensure positive b4 mod.
|
||||
let y = (dy + g_bot.y + g_box.hgt) % g_box.hgt; // Ditto y.
|
||||
let color = 100 + (1 + g_bot.color) % 156; // Incr color in nice range.
|
||||
g_bot.x = x; // Update bot x.
|
||||
g_bot.y = y;
|
||||
g_bot.dir = dir;
|
||||
g_bot.color = color;
|
||||
//console.log( "bot x,y,dir,clr = " + x + "," + y + "," + dir + "," + color );
|
||||
}
|
||||
|
||||
function draw_bot( ) // Convert bot pox to grid pos & draw bot.
|
||||
{
|
||||
let sz = g_canvas.cell_size;
|
||||
let sz2 = sz / 2;
|
||||
let x = 1+ g_bot.x*sz; // Set x one pixel inside the sz-by-sz cell.
|
||||
let y = 1+ g_bot.y*sz;
|
||||
let big = sz -2; // Stay inside cell walls.
|
||||
// Fill 'color': its a keystring, or a hexstring like "#5F", etc. See P5 docs.
|
||||
fill( "#" + g_bot.color ); // Concat string, auto-convert the number to string.
|
||||
//console.log( "x,y,big = " + x + "," + y + "," + big );
|
||||
let acolors = get( x + sz2, y + sz2 ); // Get cell interior pixel color [RGBA] array.
|
||||
let pix = acolors[ 0 ] + acolors[ 1 ] + acolors[ 2 ];
|
||||
//console.log( "acolors,pix = " + acolors + ", " + pix );
|
||||
|
||||
// (*) Here is how to detect what's at the pixel location. See P5 docs for fancier...
|
||||
if (0 != pix) { fill( 0 ); stroke( 0 ); } // Turn off color of prior bot-visited cell.
|
||||
else { stroke( 'white' ); } // Else Bot visiting this cell, so color it.
|
||||
|
||||
// Paint the cell.
|
||||
rect( x, y, big, big );
|
||||
}
|
||||
|
||||
function draw_update() // Update our display.
|
||||
{
|
||||
//console.log( "g_frame_cnt = " + g_frame_cnt );
|
||||
move_bot( );
|
||||
draw_bot( );
|
||||
}
|
||||
|
||||
function draw() // P5 Frame Re-draw Fcn, Called for Every Frame.
|
||||
{
|
||||
++g_frame_cnt;
|
||||
if (0 == g_frame_cnt % g_frame_mod)
|
||||
{
|
||||
if (!g_stop) draw_update();
|
||||
}
|
||||
}
|
||||
|
||||
function keyPressed( )
|
||||
{
|
||||
g_stop = ! g_stop;
|
||||
}
|
||||
|
||||
function mousePressed( )
|
||||
{
|
||||
let x = mouseX;
|
||||
let y = mouseY;
|
||||
//console.log( "mouse x,y = " + x + "," + y );
|
||||
let sz = g_canvas.cell_size;
|
||||
let gridx = round( (x-0.5) / sz );
|
||||
let gridy = round( (y-0.5) / sz );
|
||||
//console.log( "grid x,y = " + gridx + "," + gridy );
|
||||
//console.log( "box wid,hgt = " + g_box.wid + "," + g_box.hgt );
|
||||
g_bot.x = gridx + g_box.wid; // Ensure its positive.
|
||||
//console.log( "bot x = " + g_bot.x );
|
||||
g_bot.x %= g_box.wid; // Wrap to fit box.
|
||||
g_bot.y = gridy + g_box.hgt;
|
||||
//console.log( "bot y = " + g_bot.y );
|
||||
g_bot.y %= g_box.hgt;
|
||||
//console.log( "bot x,y = " + g_bot.x + "," + g_bot.y );
|
||||
draw_bot( );
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html> <!-- this is a JS comment --> <!-- -->
|
||||
<html lang=""> <!-- HTML page begs/ends w 'html' tag -->
|
||||
<head> <!-- HTML page has 'head'section and 'body' section -->
|
||||
<meta foo="Time-stamp: <2020-02-02 17:14:59 Chuck Siska>">
|
||||
<!-- a JS comment.-->
|
||||
<!--
|
||||
Some code, mod'd, from "Introducing JavaScript Game Development" by Stuart.
|
||||
-->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>P5-JS-HTML</title> <!-- Browser or tab title -->
|
||||
<link rel="stylesheet" href="assets/styles.css"> <!-- Tiny CSS style file -->
|
||||
<style> body {padding: 0; margin: 0;} </style> <!-- Bit of in-line CSS -->
|
||||
<script src="p5.js"></script> <!-- Load P5.JS, one file -->
|
||||
<!-- For more P5.JS, CF https://github.com/processing/p5.js/wiki -->
|
||||
<script src="cs-sketch.js"></script> <!-- Load my setup+draw P5-req'd fcns -->
|
||||
</head>
|
||||
<body> <!-- HTML page body, where raw text gets displayed on the page -->
|
||||
<h1>Playing the HTML canvas w P5</h1> <!-- Text in a high priority heading -->
|
||||
<!--
|
||||
<canvas id="cs-canvas" width="400" height="400"></canvas>
|
||||
-->
|
||||
<p> <!-- A paragraph 'break', to start a new paragraph -->
|
||||
Now is the time for all good squid to come to the aid of their waters.
|
||||
</body> <!-- HTML display page ends here -->
|
||||
<script src="assets/draw-stuff.js"></script> <!-- Load some JS fcns in a file -->
|
||||
<!-- <script src="../assets/tools.js"></script> Load more JS fcns -->
|
||||
<script> <!-- And run some JS code if needed; but better in sketch.js. -->
|
||||
|
||||
</script>
|
||||
</html>
|
||||
<!-- F12 on keyboard opens Console+Inspector+Debugger window on most Browsers. -->
|
||||
<!-- F12 Debugger window > Watch+Breakpoint pane > 2-vertical-bars icon stops anim. -->
|
||||
<!-- In JS, outputting alert/message popup, also pauses anim (with your msg). -->
|
||||
<!-- In JS, outputting pgm state info to console can help w debugging. -->
|
||||
<!-- Add a P5 keyPressed( ) fcn to toggle a Stop global var if you like. -->
|
||||
|
After Width: | Height: | Size: 146 KiB |
|
After Width: | Height: | Size: 172 KiB |
@@ -0,0 +1,80 @@
|
||||
Readme for js-p5-example
|
||||
Time-stamp: <2020-09-02 14:11:19 Chuck Siska>
|
||||
------------------------------------------------------------
|
||||
|
||||
Intro
|
||||
|
||||
This example draws a grid and runs an invisible bot from cell to cell
|
||||
on the grid changing its colors. You can stop/restart the bot with
|
||||
any keypress. You can move the bot to any cell with a mouse-click.
|
||||
|
||||
This is an example project using HTML, Javascript (JS), and P5.js
|
||||
which is a JS-adapted version of the Processing Language. CF HTML and
|
||||
JS on the web (eg, Wikipedia). More on P5 is at
|
||||
p5js.org/reference.and at github.com/processing/p5.js/wiki.
|
||||
|
||||
P5 provides sutomated animation (via a user-built "draw" function),
|
||||
and GUI manipulation functions that are simpler than JS.
|
||||
|
||||
Zip Contents
|
||||
|
||||
File readme.txt. This file.
|
||||
|
||||
File pix-js-p5-example-1.JPG. A snapshot of the example webpage.
|
||||
|
||||
File pix-js-p5-example2-F12-Console.JPG A webpage + F12 Console.
|
||||
Shows entering some global var names to see their current values.
|
||||
|
||||
File index-js-p5-example.html. Drag and drop this into a browser to
|
||||
run the example.
|
||||
Click to set new loc for drunk-bot (via mousePressed).
|
||||
Hit (almost) any key to toggle bot on or off (via keyPressed).
|
||||
|
||||
File p5.js. This is the P5 package. It is loaded inside the html.
|
||||
|
||||
File cs-sketch.js; This contains several P5 user-defined linkage functions
|
||||
(setup, draw, keyPressed, and mousePressed), as well as example
|
||||
support functions. P5's setup() is run once before page display.
|
||||
P5's draw() is run once per display frame, so you can do animation.
|
||||
|
||||
File assets/styles.css. This is an extra-small example of controlling
|
||||
webpage styling. // Loaded inside the html.
|
||||
|
||||
File assets/draw-stuff.js. This is an example to show loading a JS
|
||||
script file from a folder other than the index HTML file's
|
||||
folder location. It also includes the utility draw_grid function
|
||||
written in P5+JS. // Loaded inside the html.
|
||||
|
||||
Installation & Running
|
||||
|
||||
1. Extract the .zip file into a folder.
|
||||
|
||||
2. Drag the index HTML file, index-js-p5-example.html, into a browser
|
||||
window. The example P5 program should start immediately. You
|
||||
should see a 640x480 grid (white lines on black background) with
|
||||
row/column headers and some of the grid cells colored. See the
|
||||
picture pix-js-p5-example-1.JPG.
|
||||
|
||||
Known Bugs
|
||||
|
||||
o- Bot cell drawing over-writes a pixels-worth of the cell's grid lines.
|
||||
|
||||
Warnings
|
||||
|
||||
o- Clicking outside the grid wraps the mouse x.y back into the grid --
|
||||
maybe at a weird-looking spot. Enjoy.
|
||||
|
||||
o- Testing was light. Didn't try all key or mouse combos.
|
||||
|
||||
Testing
|
||||
|
||||
o- Following installation instruction, above, watched it run, and
|
||||
tryed a few keypresses and mouse clicks. Looks okay to ship.
|
||||
|
||||
Credits
|
||||
|
||||
Some code was borrowed and modified from Stuart's book.
|
||||
Introducing JavaScript Game Development: Build a 2D Game from the
|
||||
Ground Up, by Graeme Stuart, 2018, 209 pages.
|
||||
|
||||
And, of course, thanks to the HTML and P5.js developers.
|
||||
@@ -0,0 +1 @@
|
||||
print("hello world")
|
||||
@@ -0,0 +1,62 @@
|
||||
\documentclass[12pt,a4paper]{article}
|
||||
|
||||
\usepackage{graphicx}
|
||||
\usepackage{abstract}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{listings}
|
||||
\usepackage{indentfirst}
|
||||
|
||||
\graphicspath{ {./images/} }
|
||||
\renewcommand{\abstractname}{\large{Timestamps}}
|
||||
|
||||
\setlength{\parindent}{0.5in}
|
||||
|
||||
\title{CPSC 361 | Homework \#1 \\(Including Project Details)}
|
||||
\author{Chris Nutter\thanks{Dedicated to @QuesoGrande a.k.a. Jared D.}}
|
||||
|
||||
% --> Here we go, satellite radio, y'all get hit with a...
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
|
||||
\begin{abstract}
|
||||
\noindent
|
||||
\begin{center}\textbf{09/09/2020 - 09:36:10 AM}\end{center}
|
||||
You may want to skip the first section because it is for our group project and does not involve the textbook or python code.\\
|
||||
\begin{center}\textbf{09/12/2020 - 12:58:05 PM}\end{center}
|
||||
Sorry if there is weird spacing with the timestamps. I am currently working on fixing this. This timestamp will be deprecated if I fix the issue.\\
|
||||
\end{abstract}
|
||||
|
||||
\tableofcontents
|
||||
|
||||
% -->
|
||||
|
||||
\section{How the Project Will Work?}
|
||||
The application will be a very simple interface dedicated towards children to make sure they can follow along easily while retaining the information. Simple math is the goal while also expanding their mathematical knowledge. It'll be fairly straightforward. Multiple choice will be the way to go because it has proven to help decipher knowledge for students in the educational field. We will have a point system to tally up points per student. The more points they have, the better they're doing. The lower the points, the worse they are doing. If a student has 0 points, they are about the level we expect them to be at and we hope for them to be higher overtime. If they are lower than 0, they express issues with the topics at hand. Each problem will also have a time limit and a skip button. The time limit is set so the students don't use calculators and they work on their own. The skip button is there to provide a way to come back to the problem. Each session has a set time limit where all problems will be finished which challenges the student's to work diligently.\par
|
||||
\begin{center}\line(1,0){250}\end{center}
|
||||
|
||||
% -->
|
||||
|
||||
\section{Chapter 1 Summary}
|
||||
In the opening statements, we have a conversation between a software engineer and a game developer. The developer explains that they need to adapt a software engineering mindset towards their games or else they cannot make it out of the field alive. The textbook later explains that since technology is ever expanding, software is very important and that it requires pretty much most engineering products need some sort of software to be able to run. Software today is considered a product and just like packaging meat for a deli, we are creating a product for customers to use and it is very important for us as developers and engineers to make sure the software we deliver follow the guidelines for the industry. Unlike the early days of software engineering, we in the 21st century develop code that is proper and respectable and maintain a level of efficiency and help towards a company.\par
|
||||
The industry has changed dramatically over the years due to many improvements in hardware (as well as software). Even with major advancements, we are still getting the reverberations of scrutiny towards programmers. The nature of software is ever-changing. It changes fairly often because of how technology advances everyday.\par
|
||||
WebApps are becoming more and more common because new websites pop up everyday. Before, WebApps were mostly linked hypertext that were very limited. Now it has evolved into a huge set of languages and projects. Many main PC applications are now fully on web without needing desktop clients. This does come with its disadvantages like databases being unreliable security-wise and easy access to intrusions just when loading a website alone. Mobile applications also have improved dramatically over the years. Each application is designed with a small portable screen at hand which is why you rarely see desktop apps ported to mobile (you usually seem them rewritten from the ground up). Cloud computing is now one of the biggest ecosystems in the software engineering space mainly due to its cheaper finance for the end user and its more control over the end user. While cloud computing is useful for many as it does not rely heavily on the end-user, it gives companies more control over the software/information at hand creating a blockage between what information the company is obtaining or not. Cloud computing is the upcoming future for our children whether people want it or not.\par
|
||||
Product Line Software is defined as 'a set of software-intensive systems that share a common, managed set of features satisfying the specific needs of a particular market segment or mission and that are developed from a common set of core assets in a prescribed way." [SEI13]. This concept is very important to software engineers because it helps maintain a set of particular needs from both the front-end and back-end of a project. It helps maintain a sense of balance between the two main fields.\par
|
||||
The main issue with software engineers is time and demand. Are we able to create a project within the deadline to the specifications? Are concepts going to be cut? Who is in charge of the cutting process the people that can code or the people who want you to code? This is the ethical dilemma that mostly all software engineers face in their lifetime and there is no clear ways to solve this problem.
|
||||
\begin{center}\line(1,0){250}\end{center}
|
||||
|
||||
% -->
|
||||
|
||||
\section{Python Test Code \& Output}
|
||||
\begin{center}\includegraphics[width=13.8cm]{python-test.png}\end{center}
|
||||
I created a python project that outputs hello world with one line in Terminal.
|
||||
It creates a
|
||||
\begin{lstlisting}[language=bash]
|
||||
$ hello.py
|
||||
\end{lstlisting}
|
||||
which inputs
|
||||
\begin{lstlisting}[language=Python]
|
||||
$ print('hello world')
|
||||
\end{lstlisting} inserts the code, and executes the script. Since python's hello world is a one-liner. I needed to do something to make it a little cooler.
|
||||
\end{document}
|
||||
|
After Width: | Height: | Size: 329 KiB |
@@ -0,0 +1,164 @@
|
||||
\documentclass[12pt]{article}
|
||||
\usepackage[a4paper, total={6in, 10in}]{geometry}
|
||||
|
||||
\usepackage{graphicx}
|
||||
\usepackage{abstract}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{listings}
|
||||
\usepackage{indentfirst}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{titling}
|
||||
\usepackage{mwe}
|
||||
\usepackage{fancyhdr}
|
||||
|
||||
\graphicspath{ {./images/} }
|
||||
\renewcommand{\abstractname}{\small{\begin{center}Timestamps\end{center}\vspace{-4ex}}}
|
||||
|
||||
\setlength{\parskip}{3mm} % Add space between paragraphs.
|
||||
\setlength{\parindent}{0.5in}
|
||||
\setlength{\droptitle}{-35pt}
|
||||
\linespread{1.2}
|
||||
|
||||
\fancypagestyle{plain}{
|
||||
\vspace{3ex}
|
||||
\fancyhead[L]{October 10th, 2020}
|
||||
\renewcommand{\headrulewidth}{0.5pt}
|
||||
}
|
||||
|
||||
\pretitle{\begin{center} \LARGE \textbf}
|
||||
\posttitle{\end{center} \vspace{-3ex}}
|
||||
\preauthor{\begin{center} \large}
|
||||
\postauthor{\end{center} \vspace{-3ex}}
|
||||
\predate{\begin{center} \small \emph}
|
||||
\postdate{\end{center} \vspace{-3ex}}
|
||||
|
||||
\title{Chapter 4 \& 5 Summary}
|
||||
\author{Chris Nutter\thanks{Dedicated to @QuesoGrande a.k.a. Jared D.}}
|
||||
\date{CPSC 362}
|
||||
|
||||
% --> Here we go, satellite radio, y'all get hit with a...
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
|
||||
\begin{center} \vspace{-4ex}|\vspace{-3ex} \end{center}
|
||||
|
||||
\noindent\abstractname
|
||||
\begin{center}
|
||||
\normalsize\textbf{10/08/2020 - 01:58:55 PM}\\
|
||||
Figures of each model are at the end of the document.
|
||||
\end{center}
|
||||
\normalsize
|
||||
|
||||
\tableofcontents
|
||||
\vspace{4ex}
|
||||
|
||||
% --> First Chapter
|
||||
|
||||
\section{Chapter 4}
|
||||
\indent
|
||||
\emph{Prescriptive Process Model} is about constructing the order of software development where each task is set in order with specified guidelines.
|
||||
\emph{The Waterfall Model} sets a sequential method to development with no traversal to earlier or later stages (similar to a waterfall that goes straight down and not back up again).
|
||||
\emph{Incremental Process Model} relies on both linear and parallel processing directions to be applied; linear being the sequence of events while jumping around through increments \#n.
|
||||
\emph{Evolutionary Process Model} is very iterative which constantly improves upon over time before reaching the final product. It keeps adding to the itself which makes the project bigger and closer to the final product.
|
||||
\emph{Prototyping} is an important step to test your project and practically mandatory for releasing a product. Prototyping is often sent out to testers as a way of getting accurate reception of a product without in-house teams to influence judgement. For example a team creates a math game for 1st graders. The team will give the product to 1st graders to see how they like the product.
|
||||
\emph{The Spiral Model} is a combination of prototyping with the Waterfall Model method which is very useful for fast development of versions for teams that are stuck in a time constraint.
|
||||
\emph{Concurrent Model or sometimes concurrent engineering} is the repetitive nature of any process model mentioned.
|
||||
\emph{Specialized Process Models} take one or more attributes of other models into one model.
|
||||
\emph{Component-Based Development} is a special model that has many Spiral Model features with pre-packaged software components. There are 5 stages to the component-based development model.
|
||||
\begin{enumerate}
|
||||
\item Available component-based products are researched and evaluated for
|
||||
the application domain in question.
|
||||
\item Component integration issues are considered.
|
||||
\item A software architecture is designed to accommodate the components.
|
||||
\item Components are integrated into the architecture.
|
||||
\item Comprehensive testing is conducted to ensure proper functionality.
|
||||
\end{enumerate}
|
||||
\emph{Aspect-Oriented Software Development} is the process and methodological way of defining, specifying, designing, and constructing \emph{aspects}.
|
||||
\emph{Aspects} are ways of sub-routing and localizing the expression of crosscutting concerns.
|
||||
\emph{Concerns} are the required parameters of a customer.
|
||||
Putting it all together, \emph{crosscutting concerns} are concerns that are cut across various functions, features, and information bases.
|
||||
\emph{Unified Process} recognises importance with customer communication towards the end goal.
|
||||
\begin{enumerate}
|
||||
\item \emph{Inception} or communication and planning
|
||||
\item \emph{Elaboration} or planning and modelling
|
||||
\item \emph{Construction}
|
||||
\item \emph{Transition} or construction to deployment
|
||||
\item \emph{Production} or software implement
|
||||
\end{enumerate}
|
||||
\emph{Personal Software Process} is similar to unified process but for personal development.
|
||||
\begin{enumerate}
|
||||
\item \emph{Planning} requires isolation of requirements
|
||||
\item \emph{High-level design} requires component construction and design
|
||||
\item \emph{High-level design review} requires verification methods to find error
|
||||
\item \emph{Development} is for design refining.
|
||||
\item \emph{Postmortem} is the collected measure of each stage to analyse effectiveness.
|
||||
\end{enumerate}
|
||||
\emph{Team Software Process} is similar to PSP but requires a further team-based curriculum to tackle. Various team building suggestions include moral boosting seminars, planning goals accordingly, accelerate process by coaching, providing guidance in a respectable manner, and facilitate university teaching.
|
||||
|
||||
\section{Chapter 5}
|
||||
\indent
|
||||
\emph{Agility} is very important and widely spread across software engineering. Ivar Jacobson says "Everyone is agile. An agile team is a nimble team able to appropriately respond to changes." Agility involves the philosophy of team structures and team attitudes being used among the members including technicians, programmers, design, everyone. Agility should be applied to any software process but it is essential to understand how agility is adapted to various different processes' tasks. Agile development processes lowers the development cost compared to conventional software processes and also increases development schedule processes.\\
|
||||
\indent
|
||||
Agile software process is mentioned as the manner of addressing a number of assumption about the majority of software projects. Agility principles are important for understanding and working towards and agile software process.
|
||||
\begin{enumerate}
|
||||
\item Our highest priority is to satisfy the customer through early and continuous delivery of valuable software.
|
||||
\item Welcome changing requirements, even late in development. Agile processes harness change for the customer's competitive advantage.
|
||||
\item Deliver working software frequently, from a couple of weeks to a couple of months, with a preference to the shorter timescale.
|
||||
\item Business people and developers must work together daily throughout the project.
|
||||
\item Build projects around motivated individuals. Give them the environment and support they need, and trust them to get the job done.
|
||||
\item The most efficient and effective method of conveying information to and within a development team is face-to-face conversation.
|
||||
\item Working software is the primary measure of progress.
|
||||
\item Agile processes promote sustainable development. The sponsors, developers, and users should be able to maintain a constant pace indefinitely.
|
||||
\item Continuous attention to technical excellence and good design enhances agility.
|
||||
\item Simplicity—the art of maximizing the amount of work not done—is essential.
|
||||
\item The best architectures, requirements, and designs emerge from self organizing teams.
|
||||
\item At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly.
|
||||
\end{enumerate}
|
||||
The agile software process is very important to a proper work ethic that is fast and efficient for all parties.\\
|
||||
\indent
|
||||
\emph{The XP Process} is the object-oriented approach as a preferred development paradigm. It is labeled as the Extreme Programming for a reason. Planning the process requires listening to the people and technical members. Design which requires rigorous principles to follow by which are \textbf{keeping it simple}. Coding which is expanitory which is preliminary design implemented over time. It's not immediately ported over and needs tweaking and subtle improvements/adjustments over time. Lastly, testing which is crucial to a healthy design. Many errors will be made so adjusting and finding acceptable levels is appropriate at this step.
|
||||
\emph{Scrum} is a development method that are consistent with the agile "manifesto" and are framed into 5 basic activities.
|
||||
\begin{enumerate}
|
||||
\item Requirements
|
||||
\item Analysis
|
||||
\item Design
|
||||
\item Evolution
|
||||
\item Delivery.
|
||||
\end{enumerate}
|
||||
Each framework allocates different important step to an appropriate manifesto.
|
||||
\emph{Agile Unified Process} adopts a "serial in the large" and "iterative in the small" philosophy. Adopting the previous iteration's activities and working upon them in this one is essential and allows for updated output.\\
|
||||
\indent
|
||||
A proper agile philosophy permits a proper engineering ethic for everyone. These tools help facilitate a proper agile working habit for all members which is important for succeeding in the engineering field. Ever since the dawn of humans, we have been all been collaborating using different strengths to solve the same problems.
|
||||
|
||||
\newpage
|
||||
|
||||
\section{Images}
|
||||
|
||||
\begin{figure}[hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{waterfall.png}}
|
||||
\caption{Waterfall Model}
|
||||
\end{figure}
|
||||
\begin{figure}[hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{inc.png}}
|
||||
\caption{Incremental Model}
|
||||
\end{figure}
|
||||
\begin{figure}[hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=6.8cm]{proto.png}}
|
||||
\caption{Prototyping}
|
||||
\end{figure}
|
||||
\begin{figure}[hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{spiral.png}}
|
||||
\caption{Spiral Model}
|
||||
\end{figure}
|
||||
\begin{figure}[hbtp]
|
||||
\centering
|
||||
\fbox{\includegraphics[width=13.8cm]{unified.png}}
|
||||
\caption{Unified Model}
|
||||
\end{figure}
|
||||
|
||||
\end{document}
|
||||
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 33 KiB |
@@ -0,0 +1,76 @@
|
||||
\documentclass[12pt]{article}
|
||||
\usepackage[a4paper, total={6in, 10in}]{geometry}
|
||||
|
||||
\usepackage{graphicx}
|
||||
\usepackage{abstract}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{listings}
|
||||
\usepackage{indentfirst}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{titling}
|
||||
\usepackage{mwe}
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{setspace}
|
||||
|
||||
\graphicspath{ {./images/} }
|
||||
\renewcommand{\abstractname}{\small{\begin{center}Timestamps\end{center}\vspace{-4ex}}}
|
||||
|
||||
\setlength{\parskip}{3mm} % Add space between paragraphs.
|
||||
\setlength{\parindent}{0.5in}
|
||||
\setlength{\droptitle}{-35pt}
|
||||
\onehalfspacing
|
||||
|
||||
\fancypagestyle{plain}{
|
||||
\vspace{3ex}
|
||||
\fancyhead[L]{November 14th, 2020}
|
||||
\renewcommand{\headrulewidth}{0.5pt}
|
||||
}
|
||||
|
||||
\pretitle{\begin{center} \LARGE \textbf}
|
||||
\posttitle{\end{center} \vspace{-3ex}}
|
||||
\preauthor{\begin{center} \large}
|
||||
\postauthor{\end{center} \vspace{-3ex}}
|
||||
\predate{\begin{center} \small \emph}
|
||||
\postdate{\end{center} \vspace{-3ex}}
|
||||
|
||||
\title{Chapter 8 \& 9 Summary}
|
||||
\author{Chris Nutter\thanks{Dedicated to @QuesoGrande a.k.a. Jared D.}}
|
||||
\date{CPSC 315}
|
||||
|
||||
% --> Here we go, satellite radio, y'all get hit with a...
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
|
||||
%\begin{center} \vspace{-4ex}|\vspace{-3ex} \end{center}
|
||||
|
||||
\noindent\abstractname
|
||||
\begin{center}
|
||||
\normalsize\textbf{10/08/2020 - 01:58:55 PM}\\
|
||||
Figures of each model are at the end of the document.
|
||||
\end{center}
|
||||
\normalsize
|
||||
|
||||
\tableofcontents
|
||||
\vspace{4ex}
|
||||
|
||||
% --> First Chapter
|
||||
|
||||
\section{Chapter 8 Summary}
|
||||
\indent Having software requirements is a main staple for a good engineering ethic. If you do not have a proper set of requirements for engineers to implement, there is no purpose or drive to products and they are created on a whim (which isn't necessarily bad but it isn't proper). Requirements are designed to be showcased before starting and demonstrate a foundation for a project.
|
||||
|
||||
\end{document}
|
||||
|
||||
% Possibly Important LaTeX Functions %
|
||||
% ================================== %
|
||||
|
||||
% \begin{figure}[hbtp]
|
||||
% \centering
|
||||
% \fbox{\includegraphics[width=13.8cm]{big_o.png}}
|
||||
% \caption{Big(O) Notation}
|
||||
% \end{figure}
|
||||
|
||||
% \begin{lstlisting}[language=Python]
|
||||
% print('hello world')
|
||||
% \end{lstlisting}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
\documentclass[12pt,a4paper]{article}
|
||||
|
||||
\usepackage{graphicx}
|
||||
\usepackage{abstract}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{listings}
|
||||
\usepackage{indentfirst}
|
||||
\usepackage{amssymb}
|
||||
|
||||
\graphicspath{ {./images/} }
|
||||
\renewcommand{\abstractname}{\large{Timestamps}}
|
||||
|
||||
\setlength{\parindent}{0.5in}
|
||||
|
||||
\title{\Large{CPSC 362}\\\LARGE\textbf{{Lecture}}}
|
||||
\author{Chris Nutter\thanks{Dedicated to @QuesoGrande a.k.a. Jared D.}}
|
||||
|
||||
% --> Here we go, satellite radio, y'all get hit with a...
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
|
||||
\begin{abstract}
|
||||
\noindent
|
||||
\begin{center}\textbf{09/19/2020 - 09:51:24 AM}\end{center}
|
||||
She skipped me for the questioning. Hopefully I get marked in class.
|
||||
\end{abstract}
|
||||
|
||||
\tableofcontents
|
||||
|
||||
% --> First Chapter
|
||||
|
||||
\section{Chapter 2}
|
||||
\begin{center}\line(1,0){250}\end{center}
|
||||
|
||||
% --> Next Chapter
|
||||
|
||||
\end{document}
|
||||
|
||||
% Possibly Important LaTeX Functions %
|
||||
% ================================== %
|
||||
|
||||
% \begin{figure}[hbtp]
|
||||
% \centering
|
||||
% \fbox{\includegraphics[width=13.8cm]{big_o.png}}
|
||||
% \caption{Big(O) Notation}
|
||||
% \end{figure}
|
||||
|
||||
% \begin{lstlisting}[language=Python]
|
||||
% print('hello world')
|
||||
% \end{lstlisting}
|
||||
|
||||
|
After Width: | Height: | Size: 28 KiB |
@@ -0,0 +1,53 @@
|
||||
Chris Nutter
|
||||
Psuedocode
|
||||
|
||||
---------------------------------------------------------------------------------
|
||||
|
||||
At Startup:
|
||||
The program loads to a login screen or it auto logins.
|
||||
N U M B E R L A N D text appears at top.
|
||||
Colorful program appears.
|
||||
The program will show a picture and 5 buttons, "Time Attack", "Quiz", "Practice Mode", "Calculator", and "Exit".
|
||||
|
||||
Time Attack
|
||||
Once "Time Attack" is clicked a button is prompted to say "Ready to play?" and once clicked the game will start.
|
||||
The game generates random algorithmic math to be displayed in stdout.
|
||||
A countdown timer will also begin.
|
||||
The user will fill out answers at their pace.
|
||||
Once answered, it will immediately give response whether correct or incorrect.
|
||||
Timer:
|
||||
If timer goes out, stdin will stop and it will be left with "Game Over" text.
|
||||
A "+" button will appear to let the user increase time if desired to encourage critical thinking.
|
||||
The game keeps going until timer goes out or if stopped.
|
||||
|
||||
|
||||
Practice Mode
|
||||
This will prompt the user with "Ready to play?" and once clicked the game will start.
|
||||
This is almost verbatim quiz but will NOT UPDATE POINTS OR HISTORY.
|
||||
|
||||
Quiz
|
||||
Before playing there is an extra button to display previous ranked games called "History"
|
||||
Almost a carbon copy of "Practice Mode" except that there is a max time that cannot change.
|
||||
There also is no immediate feedback.
|
||||
Once over, the game will give a report of what was correct and incorrect.
|
||||
Quiz WILL UPDATE POINTS ALGORITHM AND UPDATE HISTORY.
|
||||
|
||||
History
|
||||
Will give a PDF of all your previous games and date.
|
||||
|
||||
Points
|
||||
Not a button.
|
||||
Text will appear at the top that gives the total rank in an algorithmic way.
|
||||
No more than 10 score. No smaller than 0.
|
||||
|
||||
Calculator
|
||||
Will create a calculator prompt at time but will auto-close during quiz.
|
||||
Buttons 0-9 and mathmatical symbols.
|
||||
|
||||
Exit
|
||||
Returns 0 and ends program
|
||||
|
||||
---------------------------------------------------------------------------------
|
||||
|
||||
This is all I can think of at the moment. Login will use mySQL and is still being considered.
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
get userID();
|
||||
get userAge();
|
||||
displayUserInfo();
|
||||
getUserInputGameMode();
|
||||
1.timeMode()
|
||||
2.quizMode()
|
||||
3.practiceMode()
|
||||
4.calculatorMode()
|
||||
5.highScore()
|
||||
Case1:
|
||||
displayTimeMode();
|
||||
userInputTimer();
|
||||
set time=userInputTimer();
|
||||
if (time >0)
|
||||
{
|
||||
A = randomA();
|
||||
B = randomB();
|
||||
answerC = A+B;
|
||||
displayA();
|
||||
displayB();
|
||||
D= randomD();
|
||||
if D=== C then randomD();
|
||||
else displayD();
|
||||
If user click on answerC then add ++ correctCounter;
|
||||
else set A=randomA(); set B=randomA();
|
||||
}
|
||||
</font></font></font><font color="#000000"> else save correctCounter to log;
|
||||
print “ Retry?” or “ exit”
|
||||
if user click retry, get userInputTimer();
|
||||
if user click exit, return to main menu;
|
||||
case2:
|
||||
question=setNumberOfQuestion();
|
||||
setArrayASize = question;
|
||||
setArrayBSize= question;
|
||||
setArrayCsize= question;
|
||||
for( i =0; i< question;i++)
|
||||
{
|
||||
arrayA[i]= random();
|
||||
arrayB[i] = random();
|
||||
arrayC[i]=arrayA[i]+arrayB[i]
|
||||
|
||||
}
|
||||
for(i=0;i<question;i++)
|
||||
{
|
||||
print arrayA[i] “ + “ print arrayB[i] “ = “
|
||||
arrayD[i]= userInput();
|
||||
if (arrayC[i]= arrayD[i] )
|
||||
correct++;
|
||||
else
|
||||
wrong++;
|
||||
}
|
||||
|
||||
display correct and wrong to screen;
|
||||
for(i=0;i<question;i++)
|
||||
{
|
||||
display arrayA[i]“+” ArrayB[i] “= “ arrayC[i] “your Answer” arrayD[i];
|
||||
|
||||
}
|
||||
ask user to continue quiz or exit to main screen
|
||||
case3:
|
||||
|
||||
if (continue = yes)
|
||||
{
|
||||
A= randomNumber();
|
||||
B= randomNumber();
|
||||
C= A+B;
|
||||
display A “+ “ B “=“ then get userInput();
|
||||
compare to C to userInput();
|
||||
get userInputContinue();
|
||||
}
|
||||
else
|
||||
exit to main menu
|
||||
|
||||
case4:
|
||||
display calculator
|
||||
|
||||
case5:
|
||||
DisplayScore();
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf2513
|
||||
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
{\*\expandedcolortbl;;}
|
||||
\margl1440\margr1440\vieww10800\viewh8400\viewkind0
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
|
||||
\f0\fs24 \cf0 starting screen:\
|
||||
get userID();\
|
||||
get userAge();\
|
||||
displayUserInfo();\
|
||||
getUserInputGameMode();\
|
||||
1.timeMode()\
|
||||
2.quizMode()\
|
||||
3.practiceMode()\
|
||||
4.calculatorMode()\
|
||||
5.highScore()\
|
||||
Case1:\
|
||||
displayTimeMode();\
|
||||
userInputTimer();\
|
||||
set time=userInputTimer();\
|
||||
if (time >0)\
|
||||
\{\
|
||||
A = randomA();\
|
||||
B = randomB();\
|
||||
answerC = A+B;\
|
||||
displayA();\
|
||||
displayB();\
|
||||
D= randomD();\
|
||||
if D=== C then randomD();\
|
||||
else displayD();\
|
||||
If user click on answerC then add ++ correctCounter;\
|
||||
else set A=randomA(); set B=randomA(); \
|
||||
\}\
|
||||
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
|
||||
\cf0 else save correctCounter to log;\
|
||||
print \'93 Retry?\'94 or \'93 exit\'94\
|
||||
if user click retry, get userInputTimer();\
|
||||
if user click exit, return to main menu;\
|
||||
case2:\
|
||||
question=setNumberOfQuestion();\
|
||||
setArrayASize = question;\
|
||||
setArrayBSize= question;\
|
||||
setArrayCsize= question;\
|
||||
for( i =0; i< question;i++)\
|
||||
\{\
|
||||
arrayA[i]= random();\
|
||||
arrayB[i] = random();\
|
||||
arrayC[i]=arrayA[i]+arrayB[i]\
|
||||
\
|
||||
\}\
|
||||
for(i=0;i<question;i++)\
|
||||
\{\
|
||||
print arrayA[i] \'93 + \'93 print arrayB[i] \'93 = \'93\
|
||||
arrayD[i]= userInput(); \
|
||||
if (arrayC[i]= arrayD[i] )\
|
||||
correct++;\
|
||||
else\
|
||||
wrong++; \
|
||||
\}\
|
||||
\
|
||||
display correct and wrong to screen;\
|
||||
for(i=0;i<question;i++)\
|
||||
\{\
|
||||
display arrayA[i]\'93+\'94 ArrayB[i] \'93= \'93 arrayC[i] \'93your Answer\'94 arrayD[i];\
|
||||
\
|
||||
\}\
|
||||
ask user to continue quiz or exit to main screen\
|
||||
case3:\
|
||||
\
|
||||
if (continue = yes)\
|
||||
\{ \
|
||||
A= randomNumber();\
|
||||
B= randomNumber();\
|
||||
C= A+B;\
|
||||
display A \'93+ \'93 B \'93=\'93 then get userInput();\
|
||||
compare to C to userInput();\
|
||||
get userInputContinue();\
|
||||
\} \
|
||||
else \
|
||||
exit to main menu\
|
||||
\
|
||||
case4:\
|
||||
display calculator\
|
||||
\
|
||||
case5:\
|
||||
DisplayScore();\
|
||||
\
|
||||
\
|
||||
\
|
||||
}
|
||||