invert.cpp

来自「非常好用的五子棋游戏源码」· C++ 代码 · 共 32 行

CPP
32
字号
// Created:10-23-98
// By Jeff Connelly

// Invert binary-repersention

// This is sort of an encryption scheme, but is very weak because the
// password is not used to encrypt.  Binary 1's become 0's, and 0's become
// 1's.

#include "stdafx.h"
#define EXPORTING
#include "comprlib.h"

static void invert();

void EXPORT invert_encode()
{
    invert();
}

void EXPORT invert_decode()
{
    invert();
}

// One function does all the work
static inline void invert()
{
    while (!end_of_data())
        write_byte(~read_byte());    // ~ means complement
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?