-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ddd0f4
commit 28e9a0a
Showing
8 changed files
with
64 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/bash | ||
|
||
rm ./dist/mac/arakilian0 | ||
clang++ src/main.cpp -o dist/mac/arakilian0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
#!/bin/bash | ||
|
||
./dist/mac/arakilian0 | ||
ARGUMENTS="" | ||
ENTRY="./dist/mac/arakilian0" | ||
|
||
for arg in $@; do | ||
ARGUMENTS+="$arg "; | ||
done | ||
|
||
COMMAND="$ENTRY $ARGUMENTS" | ||
$COMMAND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
int CharToInt(char ichar[]) { | ||
int ochar; | ||
|
||
cout << ichar << endl; | ||
|
||
// convert ichar to int | ||
// replace '0' with ochar | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
#include <iostream> | ||
#include <string> | ||
#include <array> | ||
#include <cstdlib> | ||
#include <ctime> | ||
|
||
#include "fta.h" | ||
|
||
using namespace std; | ||
|
||
string fact () { | ||
string fact (int idx = -1) { | ||
array<string, MAX_FACTS> FactArray = FileToArray("facts.txt"); | ||
srand((unsigned) time(0)); | ||
int RandomNumber = rand() % 100; | ||
int RandomNumber, oidx; | ||
|
||
if(idx > -1 && idx <= MAX_FACTS - 1) { | ||
oidx = idx; | ||
} | ||
else { | ||
srand((unsigned) time(0)); | ||
RandomNumber = rand() % 100; | ||
oidx = RandomNumber; | ||
} | ||
|
||
// cout << RandomNumber << endl; | ||
return FactArray[RandomNumber]; | ||
return FactArray[oidx]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
#include <iostream> | ||
#include <string> | ||
|
||
#include "os.h" | ||
#include "fact.h" | ||
#include "cti.h" | ||
|
||
using namespace std; | ||
|
||
int main() | ||
{ | ||
string OS = os(); | ||
string FACT = fact(); | ||
int main(int argc, char** argv) { | ||
int i, index; | ||
|
||
if(argc == 1 || argc >= 3) { | ||
cout << fact() << endl; | ||
} | ||
else { | ||
for (i = 0; i < argc; i++) { | ||
if (i == 1) { | ||
cout << "coming soon..." << endl; | ||
|
||
// the commented code below is in development | ||
|
||
// index = CharToInt(argv[i]); | ||
// cout << fact(index) << endl; | ||
} | ||
} | ||
} | ||
|
||
cout << FACT << endl; | ||
return 0; | ||
return 0; | ||
} |