俄羅斯方塊shell腳本
『壹』 Unity 做2D的俄羅斯方塊,C#的腳本
直接用一個預制數組來存預製件,每次隨機產生其中的一個預制用做下次產生的方塊。
不知道你這里保留已到達地步的方塊數據有什麼意義~
『貳』 為啥我將俄羅斯方塊的shell代碼復制粘貼到txt然後改後綴為.sh 再用shh扔到虛擬機linux上面去 運行卻報錯呢
windows文本文件的編碼 跟Linux文件地編碼不一樣,你這樣直接放上去肯定不行的。你可以用Vi打開 你的.sh文件 你看 每行末尾是^M 這就是Windows的換行編碼了。需要去掉才行的。
『叄』 shell實現俄羅斯方塊。if [[ "$1" == "--show" ]]這句話是什麼意思bash $0 --show &這句話是什麼意思
--show其實沒什麼特別的意思,主要是你運行時加了參數--show,就只有信號處理部分,你用其他方式給當前shell發一個20號信號,也會打出A;
這里主要是bash $0 --show &將信號處理後台運行,然後Kill_Signal $!函數就是read按鍵後發對應的信號給bash $0 --show &這個後台處理程序進行處理。
『肆』 shell編程高手是什麼程度
shell編程嘛,學Linux的一般都要學好,個人覺得能寫一般的腳本就可以了,大可不必在它上面花太大的功夫,有時間學一門python之類的編程語言,可方便寫很多優秀的腳本,對系統管理有很大幫助。以前有的人shell學到能寫俄羅斯方塊那種程度,但個人覺得沒必要在上面花那麼大功夫,不值!
『伍』 Scratch俄羅斯方塊小游戲的腳本
去MHOL的,我有在的,而且在玩勇敢貓
勇敢貓,因為它喜歡剛正面,比如星龍開局破頭他會和你戰正面,當然也有意外,所以星龍破頭最好不帶貓,星龍斷尾必帶勇敢貓,因為星龍找他的話,你能三段蓄力尾巴,單人斷尾只能拔刀斬,近戰單擼打尾晶爆彈勇敢貓必備,他會幫你破頭破抓[爆彈無視護甲],炸葯桶被BOSS打爆仍然有傷害的
『陸』 俄羅斯方塊環游記輔助腳本一般在哪兒可以找到
建議找游戲蜂窩吧,這個平台的輔助給力,而且升級刷金幣都很輕松。該平台的輔助工具,我更認可它,用起來,更省心更好用。《俄羅斯方塊環游記》俄羅斯方塊玩法的手游相信玩家們可能不陌生,但這是一款俄羅斯方塊正版授權的游戲,游戲包含了劇情模式對戰模式,讓游戲更加有樂趣。
『柒』 python為什麼叫python
因為python的腳本特性,python易於配置,對字元的處理也非常靈活,加上python有豐富的網路抓取模塊,所以python被叫做爬蟲。
Python爬蟲開發工程師,從網站某一個頁面(通常是首頁)開始,讀取網頁的內容,找到在網頁中的其它鏈接地址,然後通過這些鏈接地址尋找下一個網頁,這樣一直循環下去,直到把這個網站所有的網頁都抓取完為止。
如果把整個互聯網當成一個網站,那麼網路蜘蛛就可以用這個原理把互聯網上所有的網頁都抓取下來。
爬蟲,即網路爬蟲,大家可以理解為在網路上爬行的一隻蜘蛛,互聯網就比作一張大網,而爬蟲便是在這張網上爬來爬去的蜘蛛,如果它遇到自己的獵物(所需要的資源),那麼它就會將其抓取下來。
比如它在抓取一個網頁,在這個網中他發現了一條道路,其實就是指向網頁的超鏈接,那麼它就可以爬到另一張網上來獲取數據。
(7)俄羅斯方塊shell腳本擴展閱讀:
python的發展歷程
自從20世紀90年代初Python語言誕生至今,它已被逐漸廣泛應用於系統管理任務的處理和Web編程。
Python的創始人為荷蘭人吉多·范羅蘇姆 (Guido van Rossum)。1989年聖誕節期間,在阿姆斯特丹,Guido為了打發聖誕節的無趣,決心開發一個新的腳本解釋程序,作為ABC 語言的一種繼承。
之所以選中Python(大蟒蛇的意思)作為該編程語言的名字,是取自英國20世紀70年代首播的電視喜劇《蒙提.派森乾的飛行馬戲團》(Monty Python's Flying Circus)。
就這樣,Python在Guido手中誕生了。可以說,Python是從ABC發展起來,主要受到了Mola-3(另一種相當優美且強大的語言,為小型團體所設計的)的影響,並且結合了Unix shell和C的習慣。
Python 已經成為最受歡迎的程序設計語言之一,自從2004年以後,python的使用率呈線性增長。Python 2於2000年10月16日發布,穩定版本是Python 2.7,Python 3於2008年12月3日發布,不完全兼容Python 2。
由於Python語言的簡潔性、易讀性以及可擴展性,在國外用Python做科學計算的研究機構日益增多,一些知名大學已經採用Python來教授程序設計課程。
例如卡耐基梅隆大學的編程基礎、麻省理工學院的計算機科學及編程導論就使用Python語言講授。眾多開源的科學計算軟體包都提供了Python的調用介面,例如著名的計算機視覺庫OpenCV、三維可視化庫VTK、醫學圖像處理庫ITK。
『捌』 有哪些好玩兒的shell腳本
貪吃蛇 掃雷 俄羅斯方塊
用shell實現的,以前CN論壇上的大牛寫的
『玖』 為什麼shell編程不能做出來游戲
可以寫簡單的小游戲,比如俄羅斯方塊,貪吃蛇,掃雷。
畢竟shell屬於腳本類語言,做游戲還是學C,java,一些開發性的語言吧。
『拾』 J2ME俄羅斯方塊程序
#include "StdAfx.h"
#include "advWnd.h"
////////////////////////////////////////////////////////////////////////////////
//
// Class : CadvWnd
// Author : Andreas Leitner ([email protected])
// Description : A CWnd derived class that is able to redraw itself flicker free
//
////////////////////////////////////////////////////////////////////////////////
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
// MFC class creation macro
IMPLEMENT_DYNCREATE(CadvWnd, CWnd)
// MFC message map system
BEGIN_MESSAGE_MAP(CadvWnd, CWnd)
//{{AFX_MSG_MAP(CadvWnd)
ON_WM_PAINT()
ON_WM_WININICHANGE()
ON_WM_SIZE()
ON_WM_PALETTECHANGED()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
CadvWnd::CadvWnd()
{
// Init Data
m_pbmpContents = NULL;
m_bFlickerFree = FALSE;
m_iBackgroundMode = BM_DEF_WND_COL;
}
CadvWnd::~CadvWnd()
{
if (m_pbmpContents != NULL) delete m_pbmpContents;
}
#ifdef _DEBUG
void CadvWnd::AssertValid() const
{
CWnd::AssertValid();
}
void CadvWnd::Dump(CDumpContext& dc) const
{
CWnd::Dump(dc);
}
#endif //_DEBUG
BOOL CadvWnd::Create(const RECT& rect, CWnd* parent, UINT nID, CCreateContext* /*pCC*/ , DWORD style, DWORD dwExStyle)
{
HWND hwnd = ::CreateWindowEx(
dwExStyle,
"ADVANCED_WND",
0,
style,
rect.left,
rect.top,
rect.right,
rect.bottom,
parent->GetSafeHwnd(),
(HMENU) nID,
AfxGetInstanceHandle(),
0);
if (!hwnd)
{
ASSERT(0);
return FALSE;
}
else
{
SubclassWindow(hwnd);
}
if (!CreateChildren()) return FALSE;
return TRUE;
}
BOOL CadvWnd::SubclassDlgItem(UINT nID, CWnd* parent)
{
if (!CWnd::SubclassDlgItem(nID, parent)) return FALSE;
if (!CreateChildren()) return FALSE;
return TRUE;
}
WNDPROC* CadvWnd::GetSuperWndProcAddr()
{
static WNDPROC NEAR pfnSuper = NULL;
return &pfnSuper;
}
LRESULT CALLBACK CadvWnd::DummyWndProc(HWND h, UINT u, WPARAM w, LPARAM l)
{
return ::DefWindowProc(h, u, w, l);
}
void CadvWnd::RegisterClass()
{
WNDCLASS wc;
memset(&wc, 0, sizeof(wc));
wc.style = CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW | CS_GLOBALCLASS;
wc.lpfnWndProc = DummyWndProc;
wc.hInstance = AfxGetInstanceHandle();
wc.hCursor = 0;
wc.lpszClassName = "ADVANCED_WND";
wc.hbrBackground = NULL;
if (!::RegisterClass(&wc))
{
ASSERT(FALSE);
}
}
BOOL CadvWnd::CreateChildren()
{
return TRUE;
}
void CadvWnd::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rcClient;
GetClientRect(&rcClient);
if (!IsFlickerFree())
{ // Draw fast, but with flicker
if (dc.m_ps.fErase) InternalRedrawBG(&dc, rcClient);
InternalRedrawFG(&dc, rcClient);
}
else
{ // draw slow, but without flicker
// Update Bitmap
// Create a MemDC for the bitmap
CDC* pMemDC;
CBitmap* pOldBitmap;
pMemDC = new CDC;
pMemDC->CreateCompatibleDC(&dc);
pOldBitmap = pMemDC->SelectObject(m_pbmpContents);
if (IsContentsChanged())
{ // Repaint Bitmap
// After an Direct 3d app needed. Bug?
pMemDC->SelectStockObject(BLACK_PEN);
// Do the painting
InternalRedrawBG(pMemDC, rcClient);
InternalRedrawFG(pMemDC, rcClient);
// Set Contents changed back to false, since we updated the bitmap
SetContentsChanged(FALSE);
}
// Copy Bitmap
dc.BitBlt( rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), pMemDC, 0, 0, SRCCOPY);
pMemDC->SelectObject(pOldBitmap);
delete pMemDC;
}
}
void CadvWnd::InternalRedrawFG(CDC* /*pDC*/, CRect /*rcPaint*/) // (Parameter description)
{
// Nothing to do
}
void CadvWnd::InternalRedrawBG(CDC* pDC, CRect /*rcPaint*/)
{
// Paint backgroundcolor
// Select Color
COLORREF colBG;
if (GetBackgroundMode() & BM_DEF_WND_COL)
colBG = GetSysColor(COLOR_WINDOW);
if (GetBackgroundMode() & BM_CUST_COL)
colBG = GetBackgroundColor();;
// Paint background color
CRect rcClip;
pDC->GetClipBox(rcClip);
CBrush brBG;
brBG.CreateSolidBrush(colBG);
pDC->FillRect(rcClip, &brBG);
brBG.DeleteObject();
}
const int CadvWnd::GetBackgroundMode()
{
return m_iBackgroundMode;
}
void CadvWnd::SetBackgroundMode(COLORREF Color, int Mode /*= BM_CUST_COL*/)
{
m_colBackground = Color;
m_iBackgroundMode = Mode;
}
COLORREF CadvWnd::GetBackgroundColor()
{
return m_colBackground;
}
BOOL CadvWnd::IsFlickerFree()
{
return m_bFlickerFree;
}
void CadvWnd::SetFlickerFree(BOOL bFlickerFree)
{
BOOL bOld = m_bFlickerFree;
m_bFlickerFree = bFlickerFree;
if (bOld && !bFlickerFree)
{
ASSERT(m_pbmpContents != NULL);
delete m_pbmpContents;
m_pbmpContents = NULL;
}
if (!bOld && bFlickerFree)
{
ASSERT(m_pbmpContents == NULL);
m_pbmpContents = new CBitmap;
ReCreateBitmap();
}
}
void CadvWnd::OnWinIniChange(LPCTSTR lpszSection)
{
CWnd::OnWinIniChange(lpszSection);
if (IsFlickerFree())
{
ReCreateBitmap();
Invalidate();
}
}
void CadvWnd::OnSize(UINT nType, int cx, int cy)
{
CWnd::OnSize(nType, cx, cy);
if (IsFlickerFree())
ReCreateBitmap();
}
void CadvWnd::OnPaletteChanged(CWnd* pFocusWnd)
{
CWnd::OnPaletteChanged(pFocusWnd);
if (IsFlickerFree())
ReCreateBitmap();
Invalidate();
}
void CadvWnd::ReCreateBitmap()
{
ASSERT( m_pbmpContents != NULL);
CDC* pMemDC;
CDC* pDC = GetDC();
CRect rcClient;
GetClientRect(&rcClient);
delete m_pbmpContents;
m_pbmpContents = new CBitmap;
pMemDC = new CDC;
pMemDC->CreateCompatibleDC(pDC);
m_pbmpContents->CreateCompatibleBitmap( pDC, rcClient.Width(), rcClient.Height());
delete pMemDC;
SetContentsChanged();
}
void CadvWnd::SetContentsChanged(BOOL yes /*= TRUE*/)
{
m_bUpdateContents = yes;
}
BOOL CadvWnd::IsContentsChanged()
{
return m_bUpdateContents;
}
////////////////////////////////////////////////////////////////////////////////
// fan.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "fan.h"
#include "MainFrm.h"
#include "fanDoc.h"
#include "fanView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFanApp
BEGIN_MESSAGE_MAP(CFanApp, CWinApp)
//{{AFX_MSG_MAP(CFanApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFanApp construction
CFanApp::CFanApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CFanApp object
CFanApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CFanApp initialization
BOOL CFanApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to rece the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CFanDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CFanView));
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CFanApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CFanApp message handlers
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 1998 by J鰎g K鰊ig
// All rights reserved
//
// This file is part of the completely free tetris clone "CGTetris".
//
// This is free software.
// You may redistribute it by any means providing it is not sold for profit
// without the authors written consent.
//
// No warrantee of any kind, expressed or implied, is included with this
// software; use at your own risk, responsibility for damages (if any) to
// anyone resulting from the use of this software rests entirely with the
// user.
//
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
// I'll try to keep a version up to date. I can be reached as follows:
// [email protected] (company site)
// [email protected] (private site)
/////////////////////////////////////////////////////////////////////////////
#ifndef DIB256_h
#define DIB256_h
class CDIBitmap
{
friend class CBmpPalette;
BITMAPINFO * m_pInfo;
BYTE * m_pPixels;
CBmpPalette * m_pPal;
BOOL m_bIsPadded;
public: //constructors
CDIBitmap();
virtual ~CDIBitmap();
private:
CDIBitmap( const CDIBitmap& dbmp );
public: // attributes
BITMAPINFO * GetHeaderPtr() const;
BYTE * GetPixelPtr() const;
RGBQUAD * GetColorTablePtr() const;
int GetWidth() const;
int GetHeight() const;
CBmpPalette * GetPalette() { return m_pPal; }
public: // operations
BOOL CreatePalette(); // auto. made by "Load()" and "CreateFromBitmap()"
void ClearPalette(); // destroy the palette associated with this image
BOOL CreateFromBitmap( CDC *, CBitmap * );
BOOL LoadResource(LPCTSTR ID);
BOOL LoadResource(UINT ID) { return LoadResource(MAKEINTRESOURCE(ID)); }
BOOL LoadBitmap(UINT ID) { return LoadResource(ID); }
BOOL LoadBitmap(LPCTSTR ID) { return LoadResource(ID); }
void DestroyBitmap();
BOOL DeleteObject() { DestroyBitmap(); return TRUE; }
public: // overridables
// draw the bitmap at the specified location
virtual void DrawDIB( CDC * pDC, int x=0, int y=0 );
// draw the bitmap and stretch/compress it to the desired size
virtual void DrawDIB( CDC * pDC, int x, int y, int width, int height );
// draw parts of the dib into a given area of the DC
virtual int DrawDIB( CDC * pDC, CRect & rectDC, CRect & rectDIB );
// load a bitmap from disk
virtual BOOL Load( CFile * pFile );
virtual BOOL Load( const CString & );
// save the bitmap to disk
virtual BOOL Save( CFile * pFile );
virtual BOOL Save( const CString & );
protected:
int GetPalEntries() const;
int GetPalEntries( BITMAPINFOHEADER& infoHeader ) const;
DWORD GetBitsPerPixel() const;
DWORD LastByte( DWORD BitsPerPixel, DWORD PixelCount ) const;
DWORD GetBytesPerLine( DWORD BitsPerPixel, DWORD Width ) const;
BOOL PadBits();
BOOL UnPadBits();
WORD GetColorCount() const;
};
#include "dibpal.h"
#endif // DIB256_h
大概有10幾個文件,你留一下你的郵箱吧,我發給你.
我的是[email protected]
已經發到你的郵箱裡面了。我用的是:[email protected]