adde Makefile
This commit is contained in:
parent
719a91ab24
commit
22391994a3
|
@ -1 +1 @@
|
|||
flake-profile-1-link
|
||||
flake-profile-18-link
|
|
@ -1 +0,0 @@
|
|||
/nix/store/ml5jibqk9rhd8gfps532ry58njp2j5sd-nix-shell-env
|
1
tortoise/.direnv/flake-profile-18-link
Symbolic link
1
tortoise/.direnv/flake-profile-18-link
Symbolic link
|
@ -0,0 +1 @@
|
|||
/nix/store/d9kjbddwp2dsiwpvdvmaff9lpgy5rhsv-nix-shell-env
|
|
@ -1,23 +1,37 @@
|
|||
{
|
||||
description = "A Nix-flake-based Guile development environment";
|
||||
description = "A Nix-flake-based C/C++ development environment";
|
||||
|
||||
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
supportedSystems =
|
||||
[ "x86_64-linux" ];
|
||||
forEachSupportedSystem = f:
|
||||
nixpkgs.lib.genAttrs supportedSystems
|
||||
(system: f { pkgs = import nixpkgs { inherit system; }; });
|
||||
in {
|
||||
supportedSystems = [ "x86_64-linux" ];
|
||||
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
});
|
||||
in
|
||||
{
|
||||
devShells = forEachSupportedSystem ({ pkgs }: {
|
||||
default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
gnuplot
|
||||
guile
|
||||
gcc
|
||||
];
|
||||
};
|
||||
default = pkgs.mkShell.override
|
||||
{
|
||||
# Override stdenv in order to change compiler:
|
||||
stdenv = pkgs.clangStdenv;
|
||||
}
|
||||
{
|
||||
packages = with pkgs; [
|
||||
clang-tools
|
||||
cmake
|
||||
codespell
|
||||
conan
|
||||
cppcheck
|
||||
doxygen
|
||||
gtest
|
||||
lcov
|
||||
vcpkg
|
||||
vcpkg-tool
|
||||
] ++ (if system == "aarch64-darwin" then [ ] else [ gdb ]);
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
|
@ -24,7 +24,7 @@ start_gnuplot() {
|
|||
if (!pid) {
|
||||
dup2 (pipes[0], STDIN_FILENO);
|
||||
execlp ("gnuplot", NULL);
|
||||
return; /* Not reached. */
|
||||
return 0; /* Not reached. */
|
||||
}
|
||||
|
||||
output = fdopen(pipes[1], "w");
|
||||
|
@ -51,14 +51,6 @@ static void tortoise_reset () {
|
|||
fprintf(global_output, "clear\n");
|
||||
fflush(global_output);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
global_output = start_gnuplot();
|
||||
tortoise_reset ();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
static void draw_line(FILE *output, double x1, double y1, double x2,
|
||||
double y2) {
|
||||
fprintf(output, "plot [0:1] %f + %f * t, %f + %f * t notitle\n",
|
||||
|
@ -74,6 +66,11 @@ static void tortoise_penup() {
|
|||
pendown = 0;
|
||||
}
|
||||
|
||||
static void tortoise_turn (double degrees)
|
||||
{
|
||||
direction += M_PI / 180.0 * degrees;
|
||||
}
|
||||
|
||||
static void tortoise_move(double length) {
|
||||
double newX, newY;
|
||||
|
||||
|
@ -86,3 +83,17 @@ static void tortoise_move(double length) {
|
|||
x = newX;
|
||||
y = newY;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
global_output = start_gnuplot();
|
||||
tortoise_reset ();
|
||||
int i;
|
||||
tortoise_pendown();
|
||||
for (i = 1; i <= 4; ++i) {
|
||||
tortoise_move(3.0);
|
||||
tortoise_turn(90.0);
|
||||
};
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue