int check_horizon()
{
int ii,kk,ff,mm;

for(ii=0; ii<MAPY-1; ii++)
{
for(kk=1; kk<MAPX-1; kk++)
{
ff=0;
while(true)
{
if(kk+ff+1 == MAPX-1) break;

if(comm[ii,kk+ff]==0) break;
else
{
if(comm[ii,kk+ff]==comm[ii,kk+ff+1]) ff++;
else break;
}
}

if(ff>=MAXARR-1)
{
score_horizon++;
for(mm=0; mm<=ff; mm++)
{
delete_col(kk+mm, ii);
}
return(SUCC);
}
}
}
return(FAIL);
}

/*Update by 2022.04.18*/

int common_chek(int direction)
{
    int ii,kk;
    int[,] tmp = new int[MAPY,MAPX];

    for(ii=0; ii <MAPY; ii++)
    for(kk=0; kk<MAPX; kk++)
    {
        tmp[ii,kk]=comm[ii,kk];
    }

    for(ii=0; ii<ARR; ii++)
    for(kk=0; kk<ARR; kk++)
    {
        if(design[ii,kk]==1)
        {
             if(ypos+ii>MAPY-1) continue;
             if(xpos+kk>MAPX-1) continue;
             if(xpos+kk<0) continue;

             tmp[ypos+ii,xpos+kk]=0;
        }
    }

    if(direction==D_RIGHT) xpos++;
    if(direction==D_LEFT) xpos--;
    if(direction==D_DOWN) ypos++;

    ff=0;
    for(ii=0; ii<ARR; ii++)
    for(kk=0; kk<ARR; kk++)
    {
        if(design[ii,kk]==1)
        {
             if(ypos+ii>MAPY-1) continue;
             if(xpos+kk>MAPX-1) continue;
             if(xpos+kk<0) continue;

             tmp[ypos+ii,xpos+kk] += 1;
             if(tmp[ypos+ii,xpos+kk]>1) ff++;
        }
    }

    if(ff>0)
    {
        if(direction==D_RIGHT) xpos--;
        if(direction==D_LEFT) xpos++;
        if(direction==D_DOWN) ypos--;

        return(FAIL);
    }
    else
    {
        for(ii=0; ii<MAPY; ii++)
        for(kk=0; kk<MAPX; kk++)
        {
            comm[ii,kk]=tmp[ii,kk];
        }
    }
    return(SUCC);
}

 

통합 개발 환경(Integrated Development Environment, IDE)이란 
공통된 개발자 툴을 하나의 그래픽 사용자 인터페이스(Graphical User Interface, GUI)로 
결합하는 애플리케이션을 구축하기 위한 소프트웨어입니다.

DELPHI IDE(sample)
- Language : Pascal

 

C# IDE = Visual Studio(Windows)
- Language : c#

IDE없이, notepad에서 코드를 작성한후에, 실행파일을 만들수도 있다.
IDE없이, notepad에서 코드를 작성한후에, 실행파일을 만들수도 있다.

C#

[요약] C++(시플러스플러스)에 기본을 두고, 비주얼베이직(visual basic)의 편의성을 결합하여 만든 객체지향 프로그래밍언어이다.

모든 것을 객체로 취급하는 컴포넌트 프로그래밍언어로, 시샵(C-sharp)이라고 발음한다. 2000년 6월 마이크로소프트가 닷넷(.NET) 폴랫폼을 위해 개발하였다. C++(시플러스플러스)에 기본을 둔 언어로, 비주얼베이직이나 자바(Java)와도 비슷하다. 따라서 비주얼베이직과 자바·C++ 등의 장점을 지닌다. 곧 비주얼 언어가 가진 사용자 친화성, C++의 객체지향성, 자바의 분산환경처리에 적합한 다중성 등을 모두 지니는 컴포넌트 기반의 소프트웨어 개발 패러다임을 반영한다.

웹을 통해 정보와 서비스를 교환하고, 개발자들이 이식성(portability) 높은 응용프로그램들을 만들어 낼 수 있게 고안되었다. 즉, 이 프로그래밍언어를 사용하면 대대적인 개정 없이도 하나 이상의 OS(운영체제)에서 사용될 수 있는 응용프로그램들을 만들어낼 수가 있다. 따라서 프로그래머가 별도의 코드를 만들지 않고서도 새로운 제품이나 서비스를 빠르고 값싸게 시장에 내놓을 수 있게 된다.

[네이버 지식백과] C# [C-sharp] (두산백과)

Added knowledge--------------------------------
Cross Platform
Whether you're working in C#, F#, or Visual Basic, your code will run natively on any compatible OS. Different 
.NET implementations handle the heavy lifting for you:

1) .NET is a cross-platform .NET implementation for websites, servers, and console apps on Windows, Linux, and macOS.
2) .NET Framework supports websites, services, desktop apps, and more on Windows.
3) Xamarin/Mono is a .NET implementation for running apps on all the major mobile operating systems.

'테트리스' 카테고리의 다른 글

C#, Tettris :: check_horizon routine()  (0) 2022.08.31
tris::common_chek(int direction)::final  (0) 2022.04.18
테트리스 개발코드관련  (0) 2021.04.16

- c# windows console hexa, tettris code(IDE:editor,Compiler:csc) - frm version
- c# windows console hexa, tettris code(IDE:editor,Compiler:csc) - frm version
- c# windows console hexa, tettris code(IDE:editor,Compiler:csc) - frm version
- c# windows console hexa, tettris code(IDE:editor,Compiler:csc) - frm version

using statistics search(BackgroundWorker)
using statistics search(BackgroundWorker)
using statistics search(BackgroundWorker)

frm_tris_4_4.cs
0.01MB

 

simple tris + windows form edition

 

tris_frm_4_4_1.cs
0.01MB

- c# windos console hexa, tettris code(IDE:editor,Compiler:csc) - console version
- c# windos console hexa, tettris code(IDE:editor,Compiler:csc) - console version
- c# windos console hexa, tettris code(IDE:editor,Compiler:csc) - console version
_ using Console.SetCursorPosition()
_ using Console.SetCursorPosition()
_ using Console.SetCursorPosition()

 

tris_4_4.cs
0.01MB

- c# windows console hexa, tettris code(IDE:editor,Compiler:csc) - console version
- c# windows console hexa, tettris code(IDE:editor,Compiler:csc) - console version
- c# windows console hexa, tettris code(IDE:editor,Compiler:csc) - console version
- only useing Console.WriteLine()
- only useing Console.WriteLine()
- only useing Console.WriteLine()

 

pure_tris_4_4.cs
0.01MB


- c,c++ windows console hexa, tettris code(IDE:editor,Compiler:gcc)
- c,c++ windows console hexa, tettris code(IDE:editor,Compiler:gcc)
- c,c++ windows console hexa, tettris code(IDE:editor,Compiler:gcc)

 

mainsrc.c
0.00MB
common.h
0.00MB
common.c
0.01MB

 

- c# frm & feat.console & text draw version

frm_txt_draw.cs
0.02MB


- pascal window form hexa, tettris code(IDE:DELPHI) 


- javascript web-browser hexa, tettris code(IDE:editor)
- javascript web-browser hexa, tettris code(IDE:editor)
- javascript web-browser hexa, tettris code(IDE:editor)

____no_ajax_tris_4_4.html
0.02MB
____real_fast_no_ajax_tris.html
0.02MB


- c,c++ windows console tettris code(IDE:edit)
- c,c++ windows console tettris code(IDE:edit)
- c,c++ windows console tettris code(IDE:edit)

tris_basic_4_4.c
0.01MB

- c,c++ windows console tettris code(IDE:edit) - time_tick using thread
- c,c++ windows console tettris code(IDE:edit) - time_tick using thread
- c,c++ windows console tettris code(IDE:edit) - time_tick using thread

tris_thread_4_4.bat
0.00MB
tris_thread_4_4.c
0.01MB



- java console hexa, tettris code(IDE:editor,Compiler:javac)

2. Linux(Ubuntu,Centos)
- c,c++ console hexa, tettris code(IDE:editor,Compiler:gcc,실행도구:telnet terminal)
- javascript web-browser hexa, tettris code(IDE:editor,실행도구:desktop mode)

3. Windows 10 + Linux was(tomcat)
- javascript web-browser network hexa, tettris code(feat. AJAX)



# Compiler
1. windows 10 c# console - csc(freeware)
2. windows 10 c# form - visual studio(freeware at private, but company is not free)

3. windows 10 c,c++ console - gcc(freeware)
4. windows 10 c,c++ form - visual studio(freeware at private, but company is not free)

5. windows 10 pascal form - DELPHI (freeware at private, but company is not free)
6. windows 10, Linux javascript - web-browser is OK


Question into xterm92@naver.com

+ Recent posts