Move examples to another folder

This commit is contained in:
Oystein Kristoffer Tveit 2021-05-10 22:12:44 +02:00
parent 45e413eb0b
commit 6c8a80212f
14 changed files with 155 additions and 19 deletions

View File

@ -1,14 +0,0 @@
\begin{truthtable}
{c|c|c|c|c|e|c}
{$p$ & $q$ & $s$ & $p \wedge q$ & $p \Rightarrow q$ & $ p \Leftrightarrow q$ & $p \Leftrightarrow (q \wedge s)$}
\T & \T & \T & \T & \T & \T & \T
\T & \T & \F & \T & \T & \T & \F
\T & \F & \T & \F & \F & \F & \F
\T & \F & \F & \F & \F & \F & \F
\F & \T & \T & \F & \T & \F & \F
\F & \T & \F & \F & \T & \F & \T
\F & \F & \T & \F & \T & \T & \T
\F & \F & \F & \F & \T & \T & \T
\end{truthtable}

View File

@ -0,0 +1,11 @@
\newcommand{\arrow}[2]{\path [-{Latex[scale=1]}] (#1) edge (#2);}
\begin{tikzpicture}
\begin{scope}[every node/.style={shape=circle, fill=white, draw, inner sep=2pt}]
%NODES
\end{scope}
%EDGES
\end{tikzpicture}

View File

@ -0,0 +1,15 @@
.DEFAULT_GOAL := default
.PHONY: default python
default: python
pdflatex main.tex
SRC_DIR := $(shell find graphics/src -type f -printf "%f\n" -name *.txt | cut -d '.' -f1)
python:
@for f in $(SRC_DIR); \
do \
echo -e "\033[33mCOMPILING $$f.tex\033[0m"; \
python ../exam_template/python/run.py graphics/src/$$f.txt graphics/$$f.tex; \
echo ""; \
done

View File

@ -0,0 +1,30 @@
\newcommand{\arrow}[2]{\path [-{Latex[scale=1]}] (#1) edge (#2);}
\begin{tikzpicture}
\begin{scope}[every node/.style={shape=circle, fill=white, draw, inner sep=2pt}]
\node (A) at (0,3.0) {$A$};
\node (B) at (-2.59808,1.5) {$B$};
\node (C) at (-2.59808,-1.5) {$C$};
\node (D) at (-0.0,-3.0) {$D$};
\node (E) at (2.59808,-1.5) {$E$};
\node (F) at (2.59808,1.5) {$F$};
\end{scope}
\draw (A) -- (B);
\draw (A) -- (C);
\draw (A) -- (D);
\draw (A) -- (E);
\draw (A) -- (F);
\draw (B) -- (C);
\draw (B) -- (D);
\draw (B) -- (E);
\draw (B) -- (F);
\draw (C) -- (D);
\draw (C) -- (E);
\draw (C) -- (F);
\draw (D) -- (E);
\draw (D) -- (F);
\draw (E) -- (F);
\end{tikzpicture}

View File

@ -2,14 +2,14 @@
\tikzset{every node/.style={shape=circle,draw,inner sep=2pt}} \tikzset{every node/.style={shape=circle,draw,inner sep=2pt}}
\node (a) at (-0.5, 0) {$a$}; \node (a) at (-0.5, 0) {$a$};
\node (e) at (-1.0, 1) {$e$}; \node (b) at (-1.0, 1) {$b$};
\node (b) at (0.0, 1) {$b$}; \node (e) at (0.0, 1) {$e$};
\node (d) at (-1.0, 2) {$d$}; \node (c) at (-1.0, 2) {$c$};
\node (c) at (0.0, 2) {$c$}; \node (d) at (0.0, 2) {$d$};
\draw (e) -- (d);
\draw (a) -- (e); \draw (a) -- (e);
\draw (b) -- (c); \draw (b) -- (c);
\draw (e) -- (d);
\draw (a) -- (b); \draw (a) -- (b);
\draw (e) -- (c); \draw (e) -- (c);

View File

@ -1,3 +1,4 @@
# FSA
0 s 0 s
1 r0 1 r0
2 fr1 2 fr1

View File

@ -0,0 +1,4 @@
# Graph
complete
6

View File

@ -1 +1,2 @@
# Hasse
ab ac ad ae bc ed ec ab ac ad ae bc ed ec

View File

@ -1 +1,2 @@
# Truthtable
p, q, s, p and q, p implies q, E p iff q, p iff (q and s) p, q, s, p and q, p implies q, E p iff q, p iff (q and s)

View File

@ -0,0 +1,9 @@
# Graph
undirected
A B C D E F G H
AB
AC
CD
DE

View File

@ -0,0 +1,14 @@
\begin{truthtable}
{c|c|c|c|c|e|c}
{$p$ & $q$ & $s$ & $p \wedge q$ & $p \Rightarrow q$ & $ p \Leftrightarrow q$ & $p \Leftrightarrow (q \wedge s)$}
\T & \T & \T & \T & \T & \T & \T \\
\T & \T & \F & \T & \T & \T & \F \\
\T & \F & \T & \F & \F & \F & \F \\
\T & \F & \F & \F & \F & \F & \F \\
\F & \T & \T & \F & \T & \F & \F \\
\F & \T & \F & \F & \T & \F & \T \\
\F & \F & \T & \F & \T & \T & \T \\
\F & \F & \F & \F & \T & \T & \T \\
\end{truthtable}

View File

@ -0,0 +1,21 @@
\newcommand{\arrow}[2]{\path [-{Latex[scale=1]}] (#1) edge (#2);}
\begin{tikzpicture}
\begin{scope}[every node/.style={shape=circle, fill=white, draw, inner sep=2pt}]
\node (A) at (0,4.0) {$A$};
\node (B) at (-2.82843,2.82843) {$B$};
\node (C) at (-4.0,0.0) {$C$};
\node (D) at (-2.82843,-2.82843) {$D$};
\node (E) at (-0.0,-4.0) {$E$};
\node (F) at (2.82843,-2.82843) {$F$};
\node (G) at (4.0,-0.0) {$G$};
\node (H) at (2.82843,2.82843) {$H$};
\end{scope}
\draw (A) -- (B);
\draw (A) -- (C);
\draw (C) -- (D);
\draw (D) -- (E);
\end{tikzpicture}

View File

@ -0,0 +1,43 @@
\documentclass[12pt]{article}
\usepackage{ntnu}
\usepackage{ntnu-math}
\author{TODO: STUDENTNUMMER}
\title{Exam v2021}
\usetikzlibrary{automata, positioning, arrows.meta}
\newcommand{\I}{Option 1 is correct}
\newcommand{\II}{Option 2 is correct}
\newcommand{\III}{Option 3 is correct}
\renewcommand{\theenumi}{\arabic{enumi}}
\renewcommand{\theenumii}{(\arabic{enumii})}
\renewcommand{\theenumiii}{\alph{enumiii})}
\begin{document}
\ntnuTitle{}
\break{}
\tableofcontents
\begin{excs}
\exc{}
\includeDiagram{graphics/hasse.tex}
\exc{}
\includeDiagram{graphics/automata.tex}
\exc{}
\input{graphics/truthtable.tex}
\exc{}
\includeDiagram{graphics/undirectedGraph.tex}
\exc{}
\includeDiagram{graphics/complete6.tex}
\end{excs}
\end{document}