set up TUI frame module

main
The_miro 2024-11-28 09:05:05 +01:00
parent 63fee94b0d
commit 59eb9c3237
29 changed files with 343 additions and 46 deletions

16
SU420/Program.cs Normal file
View File

@ -0,0 +1,16 @@
using System;
using _TUI;
namespace SU420;
class Program
{
static void Main(string[] args)
{
Console.Clear();
TUI displ = new TUI();
Console.Clear();
Console.Write(displ.Generate());
//Console.WriteLine("1");
}
}

10
SU420/SU420.csproj Normal file
View File

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

48
SU420/TUI.cs Normal file
View File

@ -0,0 +1,48 @@
using System;
namespace _TUI
{
public class TUI
{
public TUI()
{
}
public string Generate()
{
string returnstring = "";
int w = Console.WindowWidth;
int h = Console.WindowHeight;
string[,] Terminal = new string[w,h];
//Console.WriteLine(w);
//Console.WriteLine(h);
//Console.WriteLine(Terminal.GetLength(0));
//Console.WriteLine(Terminal.GetLength(1));
for (int i=0; i<w; i++) {
for (int j=0; j<h-1; j++) {
if(i == 0 || j == 0 || i == w-2 || j == h-1 )
{
Terminal[i,j] = "#";
}else if(i == w-1){
Terminal[i,j] = "\n\r";
}else{
Terminal[i,j] = " ";
}
}
}
for (int i=0; i<w-1; i++) {
for (int j=0; j<h-1; j++) {
returnstring += Terminal[i,j];
}
}
return returnstring;
}
}
}

BIN
SU420/bin/Debug/net8.0/SU420 Executable file

Binary file not shown.

View File

@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"SU420/1.0.0": {
"runtime": {
"SU420.dll": {}
}
}
}
},
"libraries": {
"SU420/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,12 @@
{
"runtimeOptions": {
"tfm": "net8.0",
"framework": {
"name": "Microsoft.NETCore.App",
"version": "8.0.0"
},
"configProperties": {
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

4
SU420/make.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/bash
dotnet clean
dotnet build
dotnet run

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]

View File

@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("SU420")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+63fee94b0db8c3f45ee619a9129b18089462bff9")]
[assembly: System.Reflection.AssemblyProductAttribute("SU420")]
[assembly: System.Reflection.AssemblyTitleAttribute("SU420")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.

View File

@ -0,0 +1 @@
8c1c0164db9c63f007073ee6a09f30fa3f080d5c1c283ede2309883314b1e748

View File

@ -0,0 +1,13 @@
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = SU420
build_property.ProjectDir = /home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =

View File

@ -0,0 +1,8 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;

Binary file not shown.

View File

@ -0,0 +1 @@
81339b685a4c920b7990c783100ad686b7cae1fa7d3b788d76990ed24c4a0cdd

View File

@ -0,0 +1,14 @@
/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/bin/Debug/net8.0/SU420
/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/bin/Debug/net8.0/SU420.deps.json
/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/bin/Debug/net8.0/SU420.runtimeconfig.json
/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/bin/Debug/net8.0/SU420.dll
/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/bin/Debug/net8.0/SU420.pdb
/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/obj/Debug/net8.0/SU420.GeneratedMSBuildEditorConfig.editorconfig
/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/obj/Debug/net8.0/SU420.AssemblyInfoInputs.cache
/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/obj/Debug/net8.0/SU420.AssemblyInfo.cs
/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/obj/Debug/net8.0/SU420.csproj.CoreCompileInputs.cache
/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/obj/Debug/net8.0/SU420.dll
/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/obj/Debug/net8.0/refint/SU420.dll
/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/obj/Debug/net8.0/SU420.pdb
/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/obj/Debug/net8.0/SU420.genruntimeconfig.cache
/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/obj/Debug/net8.0/ref/SU420.dll

Binary file not shown.

View File

@ -0,0 +1 @@
d331bf29c19e3c4e33772e9043530eff43ef35fc72380080ad8e69c9ff00364d

Binary file not shown.

BIN
SU420/obj/Debug/net8.0/apphost Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,67 @@
{
"format": 1,
"restore": {
"/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/SU420.csproj": {}
},
"projects": {
"/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/SU420.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/SU420.csproj",
"projectName": "SU420",
"projectPath": "/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/SU420.csproj",
"packagesPath": "/home/themiro/.nuget/packages/",
"outputPath": "/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/home/themiro/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Ref",
"version": "[8.0.10, 8.0.10]"
}
],
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/8.0.110/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/home/themiro/.nuget/packages/</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/home/themiro/.nuget/packages/</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.8.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="/home/themiro/.nuget/packages/" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@ -0,0 +1,72 @@
{
"version": 3,
"targets": {
"net8.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net8.0": []
},
"packageFolders": {
"/home/themiro/.nuget/packages/": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/SU420.csproj",
"projectName": "SU420",
"projectPath": "/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/SU420.csproj",
"packagesPath": "/home/themiro/.nuget/packages/",
"outputPath": "/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/obj/",
"projectStyle": "PackageReference",
"configFilePaths": [
"/home/themiro/.nuget/NuGet/NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"downloadDependencies": [
{
"name": "Microsoft.AspNetCore.App.Ref",
"version": "[8.0.10, 8.0.10]"
}
],
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "/usr/share/dotnet/sdk/8.0.110/PortableRuntimeIdentifierGraph.json"
}
}
}
}

View File

@ -0,0 +1,10 @@
{
"version": 2,
"dgSpecHash": "gGYQR5jX3kbCd+pbrX6N/DaB1nZgWTMrnHSptB6AW/jlAFL3+Dx8rPJqEkTYEB1JTKLHmV3D4O1THA0l75TDSQ==",
"success": true,
"projectFilePath": "/home/themiro/code.dev/cshrp/Spielsucht420.exe/SU420/SU420.csproj",
"expectedPackageFiles": [
"/home/themiro/.nuget/packages/microsoft.aspnetcore.app.ref/8.0.10/microsoft.aspnetcore.app.ref.8.0.10.nupkg.sha512"
],
"logs": []
}

46
TUI.cs
View File

@ -1,46 +0,0 @@
using System;
namespace _TUI
{
public class TUI
{
public TUI()
{
}
public string Generate()
{
string returnstring = "";
int w = Console.WindowWidth;
int h = Console.WindowHeight;
char[,] Terminal = new char[w,h];
#Console.WriteLine(w);
#Console.WriteLine(h);
#Console.WriteLine(Terminal.GetLength(0));
#Console.WriteLine(Terminal.GetLength(1));
for (int i=0; i<w-1; i++) {
for (int j=0; j<h-1; j++) {
Console.Write(i);
Console.Write(" ");
Console.WriteLine(j);
if(i == 0 || j == 0 || i == Terminal.GetLength(0) || j == Terminal.GetLength(1) )
{
Terminal[i,j] = '#';
}
}
}
for (int i=0; i<w-1; i++) {
for (int j=0; j<h-1; j++) {
returnstring += Terminal[w,h];
}
}
return returnstring;
}
}
}