add a function to check if the grid has any completed lines, and if so, removes them from the grid
Sure, here's an implementation of a function to check for completed lines and remove them from the grid:
python
def remove_completed_lines(grid): completed_lines = [] for i in range(len(grid)): if all(grid[i]):
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oct 27 14:22:21 machine-name syncthing[1002]: SIGQUIT: quit | |
Oct 27 14:22:21 machine-name syncthing[1002]: PC=0x460c21 m=0 sigcode=0 | |
Oct 27 14:22:21 machine-name syncthing[1002]: goroutine 0 [idle]: | |
Oct 27 14:22:21 machine-name syncthing[1002]: runtime.futex(0x1678168, 0x80, 0x0, 0x0, 0xc000000000, 0x7ffd00000000, 0x434db3, 0xc000052848, 0x7ffd7dcb1010, 0x40adff, ...) | |
Oct 27 14:22:21 machine-name syncthing[1002]: #011/usr/local/go/src/runtime/sys_linux_amd64.s:535 +0x21 | |
Oct 27 14:22:21 machine-name syncthing[1002]: runtime.futexsleep(0x1678168, 0x7ffd00000000, 0xffffffffffffffff) | |
Oct 27 14:22:21 machine-name syncthing[1002]: #011/usr/local/go/src/runtime/os_linux.go:44 +0x46 | |
Oct 27 14:22:21 machine-name syncthing[1002]: runtime.notesleep(0x1678168) | |
Oct 27 14:22:21 machine-name syncthing[1002]: #011/usr/local/go/src/runtime/lock_futex.go:151 +0x9f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* I used this with AWS Lambda (running Node 10.x) and [Asynchronous invocation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html) | |
to trigger my glitch.com twitter bot. */ | |
var http = require('http'); | |
exports.handler = function(event, context, callback) { | |
http.get({ | |
host: process.env.HOST, | |
path: process.env.PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
import pygame | |
import random | |
import unittest | |
# Define the size of the game window and the size of each block | |
WINDOW_WIDTH = 200 | |
WINDOW_HEIGHT = 600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.yourapp; | |
import android.annotation.SuppressLint; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
import android.os.Build; | |
import android.security.KeyPairGeneratorSpec; | |
import android.security.keystore.KeyGenParameterSpec; | |
import android.security.keystore.KeyProperties; | |
import android.support.annotation.RequiresApi; |
OlderNewer