China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-24 12:52
中国DOS联盟论坛 » 网络日志(Blog) » C language (four characters) http://www.shucunwang.com/RunCode/c/ View 23,743 Replies 75
Floor 31 Posted 2016-06-26 19:11 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
gcc drawing? ! ?
Install dosemu under Linux, then download Turbo C, you should be able to try some WIN C drawing.

[ Last edited by zzz19760225 on 2017-7-25 at 21:03 ]
1<词>,2,3/段\,4{节},5(章)。
Floor 32 Posted 2016-06-26 19:14 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
```c
#include<stdio.h>
int main()
{
/* Rookie C Language Online Editor http://www.runoob.com/try/runcode.php?filename=helloworld&type=c ×/
/* Rookie Tutorial C Language http://www.runoob.com/cprogramming/c-tutorial.html */
/* One ; C Language Tutorial, Start */
printf("http://www.runoob.com/cprogramming/c-tutorial.html\n");
printf("One ; 1.1 ; C Language Tutorial\n");
printf("C language is a general-purpose, procedural computer programming language. In 1972, in order to port and develop the UNIX operating system, Dennis Ritchie designed and developed the C language at Bell Labs.\n");
printf("C language is a widely used computer language. It is as popular as the Java programming language, and both are widely used among modern software programmers.\n");
printf("---------------------------------------------------- \n");
printf("#include <stdio.h>\n");
printf("int main()\n");
printf("{\n");
printf(" /* \n");
printf(" The first C program \n");
printf(" */ \n");
printf(" printf(“Hello, World!”);\n");
/* The semicolon in the program "was originally under English, and switching the input method to Chinese can display it */
printf(" return 0;\n");
printf("}\n");
printf("--------------------------------------------------- \n");
/* One ; C Language Tutorial, End */
return 0;
}

--------------------------------------------------------------------------------------------------------------
#include <stdio.h>
int main(void)
{
printf("#include <stdio.h> \n");
printf("int main(void) \n");
printf("{ \n");
printf(" printf(\"c1.c\"); \n");
printf(" return 0; \n");
printf("} \n");
return 0;
}
-------------------------------------------------------------------------------------------------------------

[ Last edited by zzz19760225 on 2017-7-7 at 17:24 ]
```
1<词>,2,3/段\,4{节},5(章)。
Floor 33 Posted 2016-06-26 19:17 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
Chessboard standard
Rule calculation logic path module
Independent computer operation program
Independent local human operation program
Independent network operation program

Voice reporting opponent's move
Voice reporting chess pieces on the chessboard in sequence
Chessboard magnifier
Input command and input battle program
A text has 90 characters, each originally a space character. At the start, some spaces are modified to specified characters, such as new game layout and end game, review.
Each chess game is recorded once when an operation is performed, and the chess game text is recorded.

Five arrays or storage units,
The first storage unit displays a relatively fixed chessboard and records changes in the chess game, and finally outputs the statistical result.
The second storage stores independent chess piece character information and movement interrelationships, as well as multi-piece combination relationships. Under the rich combination relationships, the opponent relationship develops (maybe multi-player melee with two or more people).
The third program learns and corrects errors. A cultural program that can recognize mistakes, correct them, and enhance non-chess communication with people. Primary, secondary, university, and life principles are considered good information, which can be rejected in communication. Or a chess opponent who learns from each other while chatting.
The fourth
The fifth later extension, changing the map, changing the chess pieces, changing the rules of other simulations, similar to grand strategy-like wargame推演, the energy gathering and dispersing of life journey

Character information definition, access and path, folder standard, logic loop?
Each chessboard position is a relatively independent information group. The chess piece information in it can be accessed, the chessboard part is read-only and cannot be accessed. All chessboard positions form a chessboard. There is an operation table outside the chessboard, which is the content of making moves and counting moves.
Dual computer program. When the human-machine host battles the computer, an auxiliary computer program colludes to fight the other computer. Maybe both of them will be defeated by the other side, but they can gain an advantage in non-competition by adding problematic characters to the opponent program, often making back moves but not agreeing to the computer's back moves, reducing the computer's thinking logic content, etc. non-positive combat methods (generally don't do this because it doesn't train chess skills).
A command group: Why. When asking the computer why, the computer displays the existing logic analysis.
Information bit information, chessboard position information, chess piece information, rule quantity increase and decrease information, chess piece increase and decrease quantity information on the chessboard.
The computer and the host perform a step logic comparison. There is a choice between this step and the next step. It is assumed that the choice is an infinite loop or a finite loop of 5 times, and then the first logic scheme is selected; the middle and both ends of the scheme are randomly selected once, the both ends of the scheme select the random selection of the head and tail once, and the order of one of the head and tail of the scheme is only randomly selected according to the first two; the time is from milliseconds to seconds to minutes to hours to days, months, years, step back from small to large to find the last digit of the system time number when the last key and command are intercepted, if the millisecond is zero, step back to seconds, if there is a non-zero, according to the single or double of the intercepted single or double, the parameters for random selection before and after, single is 1, double is 2, and the scheme has several choices that need several time interceptions. When there is only one scheme, the random selection program conditions are not met, and only the only scheme is selected. The computer records the current situation of both sides' chess pieces, analyzes and collects the possible movement and capture points of the next step, as well as the landing points of the possible movement and capture points' subsequent movement and capture, compares these combinations with each other internally, and finds some subsequent random selections that damage the opponent's chess pieces more and have less loss of their own chess pieces.
Periodic scan table, similar to a warehouse summary table of daily, weekly, monthly, quarterly, annual tables. When there are few, only scan the change difference for one piece in turn. When there are many pieces and the rules change, the synchronous moves can be scanned, summarized, compared, and analyzed for selection.
Only one step is recorded under the periodic rule. One step is performed according to the preset movement and capture rules of the chess pieces. The chess pieces are selected from several schemes except the first game, including subjective initiative, objective passivity, regular selection, and imitating irregular random. A total of three types of schemes with multiple staggered combinations form a selection thinking group.
Pause button under the human-machine chess game time limit round.
Free chess pieces and various bad plots such as rascals, thieves, robbers, bullies, bandits, autocratic, strong, and also active good plots are involved, as random personality and emotional content, mixed in the interaction of dialogues. The switch of this free choice is not certain, and the host can turn it on or off at any time. Chess pieces can go back, horses can move in non-day shapes, officials can go out of the palace, elephants can move like horses, cannons can hit the target after hitting multiple chess pieces, can run out of the chessboard, can be invisible, can be resurrected, can pretend that the chess program is wrong, etc.
Statistical of own side's environment ambiguity, statistical of own side itself, statistical of own side's core threat, opponent, comparison between own side and opponent. Statistical of own side, statistical of opponent, comparison selection of statistical between own side and opponent.

[ Last edited by zzz19760225 on 2017-8-1 at 21:30 ]
1<词>,2,3/段\,4{节},5(章)。
Floor 34 Posted 2016-06-26 19:19 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
19 29 39 49 59 69 79 89 99
18 28 38 48 58 68 78 88 98
17 27 37 47 57 67 77 87 97
16 26 36 46 56 66 76 86 96
15 25 35 45 55 65 75 85 95
14 24 34 44 54 64 74 84 94
13 23 33 43 53 63 73 83 93
12 22 32 42 52 62 72 82 92
11 21 31 41 51 61 71 81 91
10 20 30 40 50 60 70 80 90


19 22419 Chariot 29 22529 Horse 39 22639 Elephant 49 22749 Advisor 59 22859 General 69 22969 Advisor 79 23079 Elephant 89 23189 Horse 99 23299 Chariot

18 28 38 48 58 68 78 88 98

17 27 22227 Cannon 37 47 57 67 77 87 22387 Cannon 97

16 21716 Pawn 26 36 21836 Pawn 46 56 21956 Pawn 66 76 22076 Pawn 86 96 22196 Pawn

15 25 35 45 55 65 75 85 95

14 24 34 44 54 64 74 84 94

13 11213 Soldier 23 33 11333 Soldier 43 53 11453 Soldier 63 73 11573 Soldier 83 93 11693 Soldier

12 22 11022 Cannon 32 42 52 62 72 82 11182 Cannon 92

11 21 31 41 51 61 71 81 91

10 10110 Chariot 20 10220 Horse 30 10330 Minister 40 10440 Assistant 50 10550 Commander 60 10660 Assistant 70 10770 Minister 80 10880 Horse 90 10990 Chariot




10 + 01 + 10 = 21 21 + 01 + 10 = 32 32 + 01 +10 = 43 43 + 01 + 10 = 54 54 + 01 + 10 = 65 65 + 01 + 10 = 76 76 + 01 + 10 = 87 87 + 01 + 10 = 98 98 + 01 = 99

99 - 01 =98 98 - 01 - 10 = 87 87 - 01 -10 = 76 76 - 01 - 10 = 65 65 - 01 - 10 = 54 54 - 01 - 10 = 43 43 - 01 - 10 = 32 32 - 01 - 10 = 21 21 - 01 - 10 = 10



Chariot 101 10 + 01~09 = 101 19 - 01~09 Chariot 101 10 + 10~90 = 101 90 - 10~90



10110=10110;2017071613:40:19;10110 + 01 = 10110;2017071613:40:20;10111 + 50 = 10110;2017071613:40:21;10161
Piece information + Selection information (game opponent both human-machine logic judgment system) + Alternative information (piece rule range) + Move information + Time information = Next move and periodic piece information
Piece information = initial piece information + incremental piece information - decremental piece information
Piece information = piece role + piece serial number + board position vertical and horizontal = 1~2 + 1~32 + 10~99 (10~90, 01~09)
x=10 ~ 99 = 90
x=x{+1}(+1)<1> ---- 0 ~ 1 Red and black sides take turns to play pieces \*Time vertical and horizontal coordinate value is zero then no movement*\
| | |----- 0 ~ 9 ± 0 ~ 9
| |---------- 1 ~ 9 ± 0 ~ 9
|---------------- Time increase and decrease Action serial number + time record form ledger

x=x(16=55+1+1+1)
x=x(16=55-1-1-1)
x=x(16=55+0+0+0)
|----32 define piece special serial number

+1 -1 0
---- + ---- + ---- = 11.11 (Calculate separately and combine to display, can the separate method of floating-point calculation be used here?)
+1 -1 0

rain
| |----0 ~ 9
|---------1 ~ 9

pizpo
---- 1 ~ 32
| |---------- 0 ~ 9
|------------1 ~ 9


Periodic scan table
123456789
9 000000000
8 100000000
7 000000000
6 000000000
5 000000000
4 000000000
3 000000000
2 000000000
1 000000000
0 000000000

12=1+increment+decrement=2+increment+decrement=condition met to terminate.
Take turns starting with 12 for periodic time rounds
Increment and decrement information for movement and capture
Condition judgment Whether 22859 and 10550 are still there
---------------------------------------------------------------------------------------------------------- >

Piece rules
1 Pawn/Soldier Soldier 11333 Select one within the movable range, check conditions: cannot - 01, if the number behind is greater than 4 then can ± 10, if the number in front is 1 then cannot - 10, if the number in front is 9 then cannot + 10.
Movement, movable range is + 01 position in front, + 10 and - 10 on the left and right. Since the number behind is 4, not greater than 4, so cannot perform left and right ± 10 selection, can only perform +01 operation.
Judge whether there is piece information in the +01 position in front, move if there is no information.
Judge whether there is piece information in the +01 position in front, replace, which is capture.
Record and compare analysis report, store in historical records and computer program information base.

[ Last edited by zzz19760225 on 2017-7-21 at 16:36 ]
1<词>,2,3/段\,4{节},5(章)。
Floor 35 Posted 2016-06-26 19:26 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
A text, sed, and shell commands form a cyclic chess game structure until the condition is met.

A move is made according to the rules. After the move is completed, an instruction according to the rules is output, which becomes the input instruction for the next step to participate.

a > b Step a is completed, output a result file as b + Overall analysis
b > c Step b is completed, output a result file as c + Overall analysis

[ Last edited by zzz19760225 on 2017-7-15 at 19:11 ]
1<词>,2,3/段\,4{节},5(章)。
Floor 36 Posted 2016-06-26 19:27 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
1<词>,2,3/段\,4{节},5(章)。
Floor 37 Posted 2016-06-26 19:28 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
1<词>,2,3/段\,4{节},5(章)。
Floor 38 Posted 2016-06-26 19:33 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
1<词>,2,3/段\,4{节},5(章)。
Floor 39 Posted 2016-06-26 19:34 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
1<词>,2,3/段\,4{节},5(章)。
Floor 40 Posted 2016-06-26 19:35 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
1<词>,2,3/段\,4{节},5(章)。
Floor 41 Posted 2016-06-26 19:37 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
1<词>,2,3/段\,4{节},5(章)。
Floor 42 Posted 2016-06-26 19:38 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
1<词>,2,3/段\,4{节},5(章)。
Floor 43 Posted 2016-06-26 19:38 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
1<词>,2,3/段\,4{节},5(章)。
Floor 44 Posted 2016-06-26 19:40 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
Table of Contents

History
Preface
I. Introduction to C Language

1. Basic Concepts of Programs

1. Programs and Programming Languages
2. Natural Languages and Formal Languages
3. Program Debugging
4. First Program

2. Constants, Variables, and Expressions

1. Continuing Hello World
2. Constants
3. Variables
4. Assignment
5. Expressions
6. Character Types and Character Encodings

3. Simple Functions

1. Mathematical Functions
2. Custom Functions
3. Formal Parameters and Actual Parameters
4. Global Variables, Local Variables, and Scope

4. Branch Statements

1. if Statement
2. if/else Statement
3. Boolean Algebra
4. switch Statement

5. In - depth Understanding of Functions

1. return Statement
2. Incremental Development
3. Recursion

6. Loop Statements

1. while Statement
2. do/while Statement
3. for Statement
4. break and continue Statements
5. Nested Loops
6. goto Statement and Labels

7. Structures

1. Composite Types and Structures
2. Data Abstraction
3. Data Type Tags
4. Nested Structures

8. Arrays

1. Basic Concepts of Arrays
2. Array Application Example: Counting Random Numbers
3. Array Application Example: Histogram
4. Strings
5. Multidimensional Arrays

9. Coding Style

1. Indentation and Whitespace
2. Comments
3. Identifier Naming
4. Functions
5. indent Tool

10. gdb

1. Single - step Execution and Tracking Function Calls
2. Breakpoints
3. Watchpoints
4. Segmentation Fault

11. Sorting and Searching

1. Concept of Algorithms
2. Insertion Sort
3. Time Complexity Analysis of Algorithms
4. Merge Sort
5. Linear Search
6. Binary Search

12. Stacks and Queues

1. Concept of Data Structures
2. Stacks
3. Depth - First Search
4. Queues and Breadth - First Search
5. Circular Queues

13. Summary of This Stage

II. Essence of C Language

14. Representation of Numbers in Computers

1. Why Computers Use Binary Counting
2. Conversion between Different Bases
3. Addition and Subtraction of Integers

3.1. Sign and Magnitude Representation
3.2. 1's Complement Representation
3.3. 2's Complement Representation
3.4. Signed Numbers and Unsigned Numbers

4. Floating - point Numbers

15. Detailed Explanation of Data Types

1. Integral Types
2. Floating - point Types
3. Type Conversions

3.1. Integer Promotion
3.2. Usual Arithmetic Conversion
3.3. Type Conversions Caused by Assignment
3.4. Casting
3.5. How Compilers Handle Type Conversions

16. Detailed Explanation of Operators

1. Bitwise Operations

1.1. Bitwise AND, OR, XOR, and NOT Operations
1.2. Shift Operations
1.3. Masks
1.4. Some Characteristics of XOR Operations

2. Other Operators

2.1. Compound Assignment Operators
2.2. Conditional Operator
2.3. Comma Operator
2.4. sizeof Operator and typedef Type Declaration

3. Side Effect and Sequence Point
4. Summary of Operators

17. Fundamentals of Computer Architecture

1. Memory and Address
2. CPU
3. Devices
4. MMU
5. Memory Hierarchy

18. Basics of x86 Assembly Programs

1. Simplest Assembly Program
2. Registers of x86
3. Second Assembly Program
4. Addressing Modes
5. ELF Files

5.1. Object Files
5.2. Executable Files

19. Relationship between Assembly and C

1. Function Calls
2. main Function and Startup Routine
3. Storage Layout of Variables
4. Structures and Unions
5. Inline Assembly in C
6. volatile Qualifier

20. Detailed Explanation of Linking

1. Linking of Multiple Object Files
2. Definitions and Declarations

2.1. extern and static Keywords
2.2. Header Files
2.3. Detailed Rules for Definitions and Declarations

3. Static Libraries
4. Shared Libraries

4.1. Compilation, Linking, and Execution
4.2. Process of Dynamic Linking
4.3. Naming Conventions of Shared Libraries

5. Virtual Memory Management

21. Preprocessing

1. Steps of Preprocessing
2. Macro Definitions

2.1. Function - like Macro Definitions
2.2. Inline Functions
2.3. #, ## Operators and Variable - length Arguments
2.4. Steps of Macro Expansion

3. Conditional Preprocessing Directives
4. Other Preprocessing Features

22. Basics of Makefile

1. Basic Rules
2. Implicit Rules and Pattern Rules
3. Variables
4. Automatic Handling of Dependencies of Header Files
5. Commonly Used make Command - line Options

23. Pointers

1. Basic Concepts of Pointers
2. Pointer - typed Parameters and Return Values
3. Pointers and Arrays
4. Pointers and const Qualifier
5. Pointers and Structures
6. Pointers to Pointers and Pointer Arrays
7. Pointers to Arrays and Multidimensional Arrays
8. Function Types and Function Pointer Types
9. Incomplete Types and Complex Declarations

24. Function Interfaces

1. Prerequisites for This Chapter

1.1. strcpy and strncpy
1.2. malloc and free

2. Incoming Parameters and Outgoing Parameters
3. Parameters of Double Pointers
4. Cases Where Return Value is a Pointer
5. Callback Functions
6. Variable - length Arguments

25. C Standard Library

1. String Manipulation Functions

1.1. Initializing Strings
1.2. Getting the Length of Strings
1.3. Copying Strings
1.4. Concatenating Strings
1.5. Comparing Strings
1.6. Searching Strings
1.7. Splitting Strings

2. Standard I/O Library Functions

2.1. Basic Concepts of Files
2.2. fopen/fclose
2.3. stdin/stdout/stderr
2.4. errno and perror Function
2.5. I/O Functions in Bytes
2.6. Functions for Manipulating Read/Write Positions
2.7. I/O Functions in Strings
2.8. I/O Functions in Records
2.9. Formatted I/O Functions
2.10. I/O Buffers of C Standard Library
2.11. Comprehensive Exercises in This Section

3. Numeric String Conversion Functions
4. Functions for Allocating Memory

26. Linked Lists, Binary Trees, and Hash Tables

1. Linked Lists

1.1. Singly Linked Lists
1.2. Doubly Linked Lists
1.3. Static Linked Lists
1.4. Comprehensive Exercises in This Section

2. Binary Trees

2.1. Basic Concepts of Binary Trees
2.2. Sorted Binary Trees

3. Hash Tables

27. Summary of This Stage

III. Linux System Programming

28. Files and I/O

1. Hello world of Assembly Programs
2. C Standard I/O Library Functions and Unbuffered I/O Functions
3. open/close
4. read/write
5. lseek
6. fcntl
7. ioctl
8. mmap

29. File Systems

1. Introduction
2. ext2 File System

2.1. Overall Storage Layout
2.2. Example Analysis
2.3. Data Block Addressing
2.4. System Functions for File and Directory Operations

3. VFS

3.1. Kernel Data Structures
3.2. dup and dup2 Functions

30. Processes

1. Introduction
2. Environment Variables
3. Process Control

3.1. fork Function
3.2. exec Function
3.3. wait and waitpid Functions

4. Inter - process Communication

4.1. Pipes
4.2. Other IPC Mechanisms

5. Exercise: Implementing a Simple Shell

31. Shell Scripts

1. History of Shell
2. How Shell Executes Commands

2.1. Executing Interactive Commands
2.2. Executing Scripts

3. Basic Syntax of Shell

3.1. Variables
3.2. Filename Substitution (Globbing): * ?
3.3. Command Substitution: ` or $()
3.4. Arithmetic Substitution: $(())
3.5. Escape Character \
3.6. Single Quotes
3.7. Double Quotes

4. bash Startup Scripts

4.1. Starting as an Interactive Login Shell or with --login Parameter
4.2. Starting as an Interactive Non - login Shell
4.3. Starting Non - interactively
4.4. Starting with sh Command

5. Shell Script Syntax

5.1. Conditional Testing: test

























































































































Last edited by zzz19760225 on 2017 - 12 - 8 at 13:18 ]
1<词>,2,3/段\,4{节},5(章)。
Floor 45 Posted 2016-06-26 19:41 ·  中国 海南 海口 电信
超级版主
★★★★
Credits 3,673
Posts 2,020
Joined 2016-02-01 00:00
10-year member
UID 181465
Gender Male
Status Offline
A simple word search software for web spiders and crawlers. A box where you enter pinyin or strokes, draw the character, then click the search button, output relevant content to a txt file and display it directly next to it, with up and down sliding buttons.

[ Last edited by zzz19760225 on 2017-7-16 at 20:17 ]
1<词>,2,3/段\,4{节},5(章)。
Forum Jump: