Explore

Explore snippets

Discover reusable code snippets, examples, fixes, and ideas shared by developers, students, and teams.

Public snippets by CodShot user
Clear
Popular tags: #beadando
7 public snippets
Open
Haskell
Public

Recursive mathematical and list functions in Haskell

Defines various recursive functions for summation, power calculations, and list operations in Haskell, including sums over ranges, power com...

Haskell Preview
module Gyak05 where


sumTo :: Integer -> Integer
sumTo x 
 | x <= 0 = 0
 | otherwise = x + sumTo (x-1)


sumBetweenHelper :: Integer -> Integer -> Integer
sumBetweenHelper n m 
 | n == m = n
 | otherwise = sumBetweenHelper n (m-1) + m

CodShot user
CodShot user
Updated: 2026-05-07 15:42
Public snippets
1 #40
Open
C#
Public

Guest class managing prizes in a game

Defines a Guest class that tracks a guest's name and the prizes (gifts) they have won, allowing addition of prizes and calculating the total...

C# Preview
using System;
using System.Collections.Generic;

namespace HF10
{
    internal class Guest
    {
        private string name;
        private List<Gift> prizes;

        public string Name
        {
            get { return name; }
        }
CodShot user
CodShot user
Updated: 2026-05-06 15:25
Public snippets
1 #37
Open
C#
Public

Singleton Pattern in C#

Defines a singleton class with a static instance method ensuring a single object and a method returning a fixed integer.

C# Preview
namespace HF10
{
    internal class S : ISize
    {
        private static S instance = null;

        private S()
        {
        }

        public static S Instance()
        {
            if (instance == null)
            {
#beadando
CodShot user
CodShot user
Updated: 2026-05-05 20:20
Public snippets
1 #34
Open
HTML / Markup
Public

Egyszerű HTML oldal alapértelmezett címkékkel

Ez a HTML kód létrehoz egy alap weboldalt egy fejléccel és egy bekezdéssel.

HTML / Markup Preview
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>This is a Heading</h1>
<p>This is a paragraph.</p>

</body>
</html>
CodShot user
CodShot user
Updated: 2026-05-05 20:07
Public snippets
1 #17
Open
C#
Public

Center.cs

C# Preview
using System;
using System.Collections.Generic;

namespace HF07
{
    internal class Center
    {
        private List<Bank> bankok;

        public Center(List<Bank> bankok)
        {
            this.bankok = bankok;
        }
CodShot user
CodShot user
Updated: 2026-04-08 15:52
Public snippets
1 #16
Open
C#
Public

ATM.cs

C# Preview
using System;

namespace HF07
{
    internal class ATM
    {
        private string location;
        private Center center;

        public ATM(string location, Center center)
        {
            this.location = location;
            this.center = center;
CodShot user
CodShot user
Updated: 2026-04-08 15:47
Public snippets
1 #13
Open
Haskell
Public

Basic Haskell Math and Utility Functions

Defines several mathematical and utility functions in Haskell including calculations for circle area, sphere volume, temperature conversion,...

Haskell Preview
module Gyak04 where

    import Data.Char(toLower, toUpper, isLower, isUpper)

    circleArea :: Double -> Double
    circleArea r = (r^2)*pi

    sphereVolume :: Double -> Double
    sphereVolume r = 4*(r^3)*pi/3

    cToF :: Double -> Double
CodShot user
CodShot user
Updated: 2026-05-07 15:40
Public snippets
0 #39
CodShot AI Help
Ask about CodShot features, plans, workspace, AI limits, referrals, and public help topics.
Hi! I can help you understand how CodShot works. What would you like to know?
For account-specific or sensitive issues, please open a support ticket. Open support