From 857de9681685bc5cfd3907ccfe87d8a9b160b968 Mon Sep 17 00:00:00 2001 From: thing 1 Date: Mon, 16 Dec 2024 13:36:15 +0000 Subject: created example --- .../writeup2/examples/fib/c++/fib.cpp | 16 +++ .../writeup2/examples/fib/go/fib.go | 14 +++ .../writeup2/examples/fib/go/go.mod | 3 + comp/lucas-standen-NEA/writeup2/examples/fib/go/m | Bin 0 -> 2131040 bytes .../writeup2/examples/fib/haskell/CHANGELOG.md | 5 + .../writeup2/examples/fib/haskell/app/Main.hs | 8 ++ .../haskell/build/haskell/autogen/Paths_haskell.hs | 74 +++++++++++++ .../x/haskell/build/haskell/autogen/cabal_macros.h | 120 +++++++++++++++++++++ .../x/haskell/build/haskell/haskell | Bin 0 -> 17280 bytes .../haskell/build/haskell/haskell-tmp/Main.dyn_hi | Bin 0 -> 1985 bytes .../x/haskell/build/haskell/haskell-tmp/Main.dyn_o | Bin 0 -> 5800 bytes .../haskell-0.1.0.0/x/haskell/cache/build | Bin 0 -> 314 bytes .../haskell-0.1.0.0/x/haskell/cache/config | Bin 0 -> 3419 bytes .../haskell-0.1.0.0/x/haskell/cache/registration | Bin 0 -> 33 bytes .../x/haskell/package.conf.inplace/package.cache | Bin 0 -> 40 bytes .../package.conf.inplace/package.cache.lock | 0 .../haskell-0.1.0.0/x/haskell/setup-config | Bin 0 -> 48744 bytes .../fib/haskell/dist-newstyle/cache/compiler | Bin 0 -> 12292 bytes .../fib/haskell/dist-newstyle/cache/config | Bin 0 -> 2975 bytes .../haskell/dist-newstyle/cache/elaborated-plan | Bin 0 -> 32659 bytes .../fib/haskell/dist-newstyle/cache/improved-plan | Bin 0 -> 50630 bytes .../fib/haskell/dist-newstyle/cache/plan.json | 1 + .../fib/haskell/dist-newstyle/cache/solver-plan | Bin 0 -> 69001 bytes .../fib/haskell/dist-newstyle/cache/source-hashes | Bin 0 -> 155 bytes .../fib/haskell/dist-newstyle/cache/up-to-date | Bin 0 -> 129 bytes .../packagedb/ghc-9.2.8/package.cache | Bin 0 -> 40 bytes .../packagedb/ghc-9.2.8/package.cache.lock | 0 .../writeup2/examples/fib/haskell/haskell.cabal | 34 ++++++ .../writeup2/examples/fib/java/Main.class | Bin 0 -> 496 bytes .../writeup2/examples/fib/java/fib.java | 12 +++ .../writeup2/examples/fib/python/fib.py | 8 ++ .../writeup2/examples/fib/rust/fib | Bin 0 -> 420600 bytes .../writeup2/examples/fib/rust/fib.rs | 11 ++ .../writeup2/examples/fib/zpy/fib.zpy | 14 +++ 34 files changed, 320 insertions(+) create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/c++/fib.cpp create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/go/fib.go create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/go/go.mod create mode 100755 comp/lucas-standen-NEA/writeup2/examples/fib/go/m create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/CHANGELOG.md create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/app/Main.hs create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/autogen/Paths_haskell.hs create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/autogen/cabal_macros.h create mode 100755 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/haskell create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/haskell-tmp/Main.dyn_hi create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/haskell-tmp/Main.dyn_o create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/cache/build create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/cache/config create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/cache/registration create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/package.conf.inplace/package.cache create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/package.conf.inplace/package.cache.lock create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/setup-config create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/compiler create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/config create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/elaborated-plan create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/improved-plan create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/plan.json create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/solver-plan create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/source-hashes create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/up-to-date create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/packagedb/ghc-9.2.8/package.cache create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/packagedb/ghc-9.2.8/package.cache.lock create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/haskell/haskell.cabal create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/java/Main.class create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/java/fib.java create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/python/fib.py create mode 100755 comp/lucas-standen-NEA/writeup2/examples/fib/rust/fib create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/rust/fib.rs create mode 100644 comp/lucas-standen-NEA/writeup2/examples/fib/zpy/fib.zpy (limited to 'comp/lucas-standen-NEA/writeup2/examples/fib') diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/c++/fib.cpp b/comp/lucas-standen-NEA/writeup2/examples/fib/c++/fib.cpp new file mode 100644 index 0000000..ce55901 --- /dev/null +++ b/comp/lucas-standen-NEA/writeup2/examples/fib/c++/fib.cpp @@ -0,0 +1,16 @@ +#include + +class fibclass { + public: + int run(int n){ + if (n < 2) return n; + return run(n - 1) + run(n - 2); + } +}; + +int main(){ + fibclass obj = fibclass(); + std::cout << obj.run(10); + std::cout << "\n"; +} + diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/go/fib.go b/comp/lucas-standen-NEA/writeup2/examples/fib/go/fib.go new file mode 100644 index 0000000..4ef84a8 --- /dev/null +++ b/comp/lucas-standen-NEA/writeup2/examples/fib/go/fib.go @@ -0,0 +1,14 @@ +package main + +import "fmt" + +func fib(n int) int { + if (n < 2) { + return n + } + return fib(n-1) + fib(n-2) +} + +func main(){ + fmt.Println(fib(10)) +} diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/go/go.mod b/comp/lucas-standen-NEA/writeup2/examples/fib/go/go.mod new file mode 100644 index 0000000..a851617 --- /dev/null +++ b/comp/lucas-standen-NEA/writeup2/examples/fib/go/go.mod @@ -0,0 +1,3 @@ +module example.com/m/v2 + +go 1.23.4 diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/go/m b/comp/lucas-standen-NEA/writeup2/examples/fib/go/m new file mode 100755 index 0000000..847fe36 Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/go/m differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/CHANGELOG.md b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/CHANGELOG.md new file mode 100644 index 0000000..500a0d0 --- /dev/null +++ b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/CHANGELOG.md @@ -0,0 +1,5 @@ +# Revision history for haskell + +## 0.1.0.0 -- YYYY-mm-dd + +* First version. Released on an unsuspecting world. diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/app/Main.hs b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/app/Main.hs new file mode 100644 index 0000000..5571519 --- /dev/null +++ b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/app/Main.hs @@ -0,0 +1,8 @@ +import Prelude + +fib :: Integer -> Integer +fib n | n < 2 = n + | otherwise = fib(n - 1) + fib(n - 2) + +main :: IO() +main = print $ fib(10) diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/autogen/Paths_haskell.hs b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/autogen/Paths_haskell.hs new file mode 100644 index 0000000..e1b049e --- /dev/null +++ b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/autogen/Paths_haskell.hs @@ -0,0 +1,74 @@ +{-# LANGUAGE CPP #-} +{-# LANGUAGE NoRebindableSyntax #-} +{-# OPTIONS_GHC -fno-warn-missing-import-lists #-} +{-# OPTIONS_GHC -w #-} +module Paths_haskell ( + version, + getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, + getDataFileName, getSysconfDir + ) where + + +import qualified Control.Exception as Exception +import qualified Data.List as List +import Data.Version (Version(..)) +import System.Environment (getEnv) +import Prelude + + +#if defined(VERSION_base) + +#if MIN_VERSION_base(4,0,0) +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a +#else +catchIO :: IO a -> (Exception.Exception -> IO a) -> IO a +#endif + +#else +catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a +#endif +catchIO = Exception.catch + +version :: Version +version = Version [0,1,0,0] [] + +getDataFileName :: FilePath -> IO FilePath +getDataFileName name = do + dir <- getDataDir + return (dir `joinFileName` name) + +getBinDir, getLibDir, getDynLibDir, getDataDir, getLibexecDir, getSysconfDir :: IO FilePath + + + +bindir, libdir, dynlibdir, datadir, libexecdir, sysconfdir :: FilePath +bindir = "/home/thing1/.cabal/bin" +libdir = "/home/thing1/.cabal/lib/x86_64-linux-ghc-9.2.8/haskell-0.1.0.0-inplace-haskell" +dynlibdir = "/home/thing1/.cabal/lib/x86_64-linux-ghc-9.2.8" +datadir = "/home/thing1/.cabal/share/x86_64-linux-ghc-9.2.8/haskell-0.1.0.0" +libexecdir = "/home/thing1/.cabal/libexec/x86_64-linux-ghc-9.2.8/haskell-0.1.0.0" +sysconfdir = "/home/thing1/.cabal/etc" + +getBinDir = catchIO (getEnv "haskell_bindir") (\_ -> return bindir) +getLibDir = catchIO (getEnv "haskell_libdir") (\_ -> return libdir) +getDynLibDir = catchIO (getEnv "haskell_dynlibdir") (\_ -> return dynlibdir) +getDataDir = catchIO (getEnv "haskell_datadir") (\_ -> return datadir) +getLibexecDir = catchIO (getEnv "haskell_libexecdir") (\_ -> return libexecdir) +getSysconfDir = catchIO (getEnv "haskell_sysconfdir") (\_ -> return sysconfdir) + + + + +joinFileName :: String -> String -> FilePath +joinFileName "" fname = fname +joinFileName "." fname = fname +joinFileName dir "" = dir +joinFileName dir fname + | isPathSeparator (List.last dir) = dir ++ fname + | otherwise = dir ++ pathSeparator : fname + +pathSeparator :: Char +pathSeparator = '/' + +isPathSeparator :: Char -> Bool +isPathSeparator c = c == '/' diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/autogen/cabal_macros.h b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/autogen/cabal_macros.h new file mode 100644 index 0000000..34b2b11 --- /dev/null +++ b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/autogen/cabal_macros.h @@ -0,0 +1,120 @@ +/* DO NOT EDIT: This file is automatically generated by Cabal */ + +/* package haskell-0.1.0.0 */ +#ifndef VERSION_haskell +#define VERSION_haskell "0.1.0.0" +#endif /* VERSION_haskell */ +#ifndef MIN_VERSION_haskell +#define MIN_VERSION_haskell(major1,major2,minor) (\ + (major1) < 0 || \ + (major1) == 0 && (major2) < 1 || \ + (major1) == 0 && (major2) == 1 && (minor) <= 0) +#endif /* MIN_VERSION_haskell */ +/* package base-4.16.4.0 */ +#ifndef VERSION_base +#define VERSION_base "4.16.4.0" +#endif /* VERSION_base */ +#ifndef MIN_VERSION_base +#define MIN_VERSION_base(major1,major2,minor) (\ + (major1) < 4 || \ + (major1) == 4 && (major2) < 16 || \ + (major1) == 4 && (major2) == 16 && (minor) <= 4) +#endif /* MIN_VERSION_base */ + +/* tool gcc-14.2.1 */ +#ifndef TOOL_VERSION_gcc +#define TOOL_VERSION_gcc "14.2.1" +#endif /* TOOL_VERSION_gcc */ +#ifndef MIN_TOOL_VERSION_gcc +#define MIN_TOOL_VERSION_gcc(major1,major2,minor) (\ + (major1) < 14 || \ + (major1) == 14 && (major2) < 2 || \ + (major1) == 14 && (major2) == 2 && (minor) <= 1) +#endif /* MIN_TOOL_VERSION_gcc */ +/* tool ghc-9.2.8 */ +#ifndef TOOL_VERSION_ghc +#define TOOL_VERSION_ghc "9.2.8" +#endif /* TOOL_VERSION_ghc */ +#ifndef MIN_TOOL_VERSION_ghc +#define MIN_TOOL_VERSION_ghc(major1,major2,minor) (\ + (major1) < 9 || \ + (major1) == 9 && (major2) < 2 || \ + (major1) == 9 && (major2) == 2 && (minor) <= 8) +#endif /* MIN_TOOL_VERSION_ghc */ +/* tool ghc-pkg-9.2.8 */ +#ifndef TOOL_VERSION_ghc_pkg +#define TOOL_VERSION_ghc_pkg "9.2.8" +#endif /* TOOL_VERSION_ghc_pkg */ +#ifndef MIN_TOOL_VERSION_ghc_pkg +#define MIN_TOOL_VERSION_ghc_pkg(major1,major2,minor) (\ + (major1) < 9 || \ + (major1) == 9 && (major2) < 2 || \ + (major1) == 9 && (major2) == 2 && (minor) <= 8) +#endif /* MIN_TOOL_VERSION_ghc_pkg */ +/* tool haddock-2.26.0 */ +#ifndef TOOL_VERSION_haddock +#define TOOL_VERSION_haddock "2.26.0" +#endif /* TOOL_VERSION_haddock */ +#ifndef MIN_TOOL_VERSION_haddock +#define MIN_TOOL_VERSION_haddock(major1,major2,minor) (\ + (major1) < 2 || \ + (major1) == 2 && (major2) < 26 || \ + (major1) == 2 && (major2) == 26 && (minor) <= 0) +#endif /* MIN_TOOL_VERSION_haddock */ +/* tool hpc-0.68 */ +#ifndef TOOL_VERSION_hpc +#define TOOL_VERSION_hpc "0.68" +#endif /* TOOL_VERSION_hpc */ +#ifndef MIN_TOOL_VERSION_hpc +#define MIN_TOOL_VERSION_hpc(major1,major2,minor) (\ + (major1) < 0 || \ + (major1) == 0 && (major2) < 68 || \ + (major1) == 0 && (major2) == 68 && (minor) <= 0) +#endif /* MIN_TOOL_VERSION_hpc */ +/* tool hsc2hs-0.68.8 */ +#ifndef TOOL_VERSION_hsc2hs +#define TOOL_VERSION_hsc2hs "0.68.8" +#endif /* TOOL_VERSION_hsc2hs */ +#ifndef MIN_TOOL_VERSION_hsc2hs +#define MIN_TOOL_VERSION_hsc2hs(major1,major2,minor) (\ + (major1) < 0 || \ + (major1) == 0 && (major2) < 68 || \ + (major1) == 0 && (major2) == 68 && (minor) <= 8) +#endif /* MIN_TOOL_VERSION_hsc2hs */ +/* tool pkg-config-2.3.0 */ +#ifndef TOOL_VERSION_pkg_config +#define TOOL_VERSION_pkg_config "2.3.0" +#endif /* TOOL_VERSION_pkg_config */ +#ifndef MIN_TOOL_VERSION_pkg_config +#define MIN_TOOL_VERSION_pkg_config(major1,major2,minor) (\ + (major1) < 2 || \ + (major1) == 2 && (major2) < 3 || \ + (major1) == 2 && (major2) == 3 && (minor) <= 0) +#endif /* MIN_TOOL_VERSION_pkg_config */ +/* tool runghc-9.2.8 */ +#ifndef TOOL_VERSION_runghc +#define TOOL_VERSION_runghc "9.2.8" +#endif /* TOOL_VERSION_runghc */ +#ifndef MIN_TOOL_VERSION_runghc +#define MIN_TOOL_VERSION_runghc(major1,major2,minor) (\ + (major1) < 9 || \ + (major1) == 9 && (major2) < 2 || \ + (major1) == 9 && (major2) == 2 && (minor) <= 8) +#endif /* MIN_TOOL_VERSION_runghc */ +/* tool strip-2.43 */ +#ifndef TOOL_VERSION_strip +#define TOOL_VERSION_strip "2.43" +#endif /* TOOL_VERSION_strip */ +#ifndef MIN_TOOL_VERSION_strip +#define MIN_TOOL_VERSION_strip(major1,major2,minor) (\ + (major1) < 2 || \ + (major1) == 2 && (major2) < 43 || \ + (major1) == 2 && (major2) == 43 && (minor) <= 0) +#endif /* MIN_TOOL_VERSION_strip */ + +#ifndef CURRENT_COMPONENT_ID +#define CURRENT_COMPONENT_ID "haskell-0.1.0.0-inplace-haskell" +#endif /* CURRENT_COMPONENT_ID */ +#ifndef CURRENT_PACKAGE_VERSION +#define CURRENT_PACKAGE_VERSION "0.1.0.0" +#endif /* CURRENT_PACKAGE_VERSION */ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/haskell b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/haskell new file mode 100755 index 0000000..edb4e5d Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/haskell differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/haskell-tmp/Main.dyn_hi b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/haskell-tmp/Main.dyn_hi new file mode 100644 index 0000000..e4c1256 Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/haskell-tmp/Main.dyn_hi differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/haskell-tmp/Main.dyn_o b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/haskell-tmp/Main.dyn_o new file mode 100644 index 0000000..16ea7ea Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/haskell-tmp/Main.dyn_o differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/cache/build b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/cache/build new file mode 100644 index 0000000..920bc19 Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/cache/build differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/cache/config b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/cache/config new file mode 100644 index 0000000..10499cc Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/cache/config differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/cache/registration b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/cache/registration new file mode 100644 index 0000000..b755b9f Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/cache/registration differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/package.conf.inplace/package.cache b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/package.conf.inplace/package.cache new file mode 100644 index 0000000..b3cae5c Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/package.conf.inplace/package.cache differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/package.conf.inplace/package.cache.lock b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/package.conf.inplace/package.cache.lock new file mode 100644 index 0000000..e69de29 diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/setup-config b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/setup-config new file mode 100644 index 0000000..450c04a Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/setup-config differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/compiler b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/compiler new file mode 100644 index 0000000..9d46463 Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/compiler differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/config b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/config new file mode 100644 index 0000000..1b17af2 Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/config differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/elaborated-plan b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/elaborated-plan new file mode 100644 index 0000000..95bbdbc Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/elaborated-plan differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/improved-plan b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/improved-plan new file mode 100644 index 0000000..4a2fc7b Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/improved-plan differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/plan.json b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/plan.json new file mode 100644 index 0000000..a9d09f9 --- /dev/null +++ b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/plan.json @@ -0,0 +1 @@ +{"cabal-version":"3.6.2.0","cabal-lib-version":"3.6.3.0","compiler-id":"ghc-9.2.8","os":"linux","arch":"x86_64","install-plan":[{"type":"pre-existing","id":"base-4.16.4.0","pkg-name":"base","pkg-version":"4.16.4.0","depends":["ghc-bignum-1.2","ghc-prim-0.8.0","rts-1.0.2"]},{"type":"pre-existing","id":"ghc-bignum-1.2","pkg-name":"ghc-bignum","pkg-version":"1.2","depends":["ghc-prim-0.8.0"]},{"type":"pre-existing","id":"ghc-prim-0.8.0","pkg-name":"ghc-prim","pkg-version":"0.8.0","depends":["rts-1.0.2"]},{"type":"configured","id":"haskell-0.1.0.0-inplace-haskell","pkg-name":"haskell","pkg-version":"0.1.0.0","flags":{},"style":"local","pkg-src":{"type":"local","path":"/home/thing1/school/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/."},"dist-dir":"/home/thing1/school/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell","depends":["base-4.16.4.0"],"exe-depends":[],"component-name":"exe:haskell","bin-file":"/home/thing1/school/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/build/x86_64-linux/ghc-9.2.8/haskell-0.1.0.0/x/haskell/build/haskell/haskell"},{"type":"pre-existing","id":"rts-1.0.2","pkg-name":"rts","pkg-version":"1.0.2","depends":[]}]} \ No newline at end of file diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/solver-plan b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/solver-plan new file mode 100644 index 0000000..b7caf03 Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/solver-plan differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/source-hashes b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/source-hashes new file mode 100644 index 0000000..025c4f7 Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/source-hashes differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/up-to-date b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/up-to-date new file mode 100644 index 0000000..f80eb87 Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/cache/up-to-date differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/packagedb/ghc-9.2.8/package.cache b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/packagedb/ghc-9.2.8/package.cache new file mode 100644 index 0000000..b3cae5c Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/packagedb/ghc-9.2.8/package.cache differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/packagedb/ghc-9.2.8/package.cache.lock b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/dist-newstyle/packagedb/ghc-9.2.8/package.cache.lock new file mode 100644 index 0000000..e69de29 diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/haskell.cabal b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/haskell.cabal new file mode 100644 index 0000000..e4262c3 --- /dev/null +++ b/comp/lucas-standen-NEA/writeup2/examples/fib/haskell/haskell.cabal @@ -0,0 +1,34 @@ +cabal-version: 2.4 +name: haskell +version: 0.1.0.0 + +-- A short (one-line) description of the package. +-- synopsis: + +-- A longer description of the package. +-- description: + +-- A URL where users can report bugs. +-- bug-reports: + +-- The license under which the package is released. +-- license: +author: thing 1 +maintainer: thing1@seacrossedlovers.xyz + +-- A copyright notice. +-- copyright: +-- category: +extra-source-files: CHANGELOG.md + +executable haskell + main-is: Main.hs + + -- Modules included in this executable, other than Main. + -- other-modules: + + -- LANGUAGE extensions used by modules in this package. + -- other-extensions: + build-depends: base ^>=4.16.4.0 + hs-source-dirs: app + default-language: Haskell2010 diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/java/Main.class b/comp/lucas-standen-NEA/writeup2/examples/fib/java/Main.class new file mode 100644 index 0000000..9e979a8 Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/java/Main.class differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/java/fib.java b/comp/lucas-standen-NEA/writeup2/examples/fib/java/fib.java new file mode 100644 index 0000000..92966bd --- /dev/null +++ b/comp/lucas-standen-NEA/writeup2/examples/fib/java/fib.java @@ -0,0 +1,12 @@ +class Main { + static int fib(int n) { + if (n < 2) { + return n; + } + return fib(n - 1) + fib(n - 2); + } + + public static void main(String[] args) { + System.out.println(fib(10)); + } +} diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/python/fib.py b/comp/lucas-standen-NEA/writeup2/examples/fib/python/fib.py new file mode 100644 index 0000000..cdf31ad --- /dev/null +++ b/comp/lucas-standen-NEA/writeup2/examples/fib/python/fib.py @@ -0,0 +1,8 @@ +def fib(n): + if (n < 2): + return n + + return fib(n-1) + fib(n-2) + +val = 10 +print(fib(val)) diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/rust/fib b/comp/lucas-standen-NEA/writeup2/examples/fib/rust/fib new file mode 100755 index 0000000..39c0328 Binary files /dev/null and b/comp/lucas-standen-NEA/writeup2/examples/fib/rust/fib differ diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/rust/fib.rs b/comp/lucas-standen-NEA/writeup2/examples/fib/rust/fib.rs new file mode 100644 index 0000000..13ed7e9 --- /dev/null +++ b/comp/lucas-standen-NEA/writeup2/examples/fib/rust/fib.rs @@ -0,0 +1,11 @@ +fn fib(n: i32) -> i32 { + if n < 2 { + return n; + } + return fib(n - 1) + fib(n - 2); +} + +fn main(){ + let val = fib(10); + println!("{val}"); +} diff --git a/comp/lucas-standen-NEA/writeup2/examples/fib/zpy/fib.zpy b/comp/lucas-standen-NEA/writeup2/examples/fib/zpy/fib.zpy new file mode 100644 index 0000000..adb2a71 --- /dev/null +++ b/comp/lucas-standen-NEA/writeup2/examples/fib/zpy/fib.zpy @@ -0,0 +1,14 @@ +(defun fib int n:int) + (if (< n 2)) + (return n) + (endif) + + (return (+ (fib (- n 1)) (fib (- n 2)))) +(endfun) + +(defun main int) + (printstr "give me a number (bellow 30 if you want it to be quick): ") + (let n:int (readint)) + (printint (fib n)) + (printchar '\n') +(endfun) -- cgit v1.2.3