Find Jobs
Hire Freelancers

I need help on haskell connect four

$30-250 USD

Закрито
Опублікований over 5 years ago

$30-250 USD

Оплачується при отриманні
I am a student and we were assigned a project in haskell. I have been trying for days but cannot seem to grasp the concept. Help would be much appreciated!
ID проекту: 18260656

Про проект

5 пропозицій(-ї)
Дистанційний проект
Активність 5 yrs ago

Хочете заробити?

Переваги подання заявок на Freelancer

Вкажіть свій бюджет та терміни
Отримайте гроші за свою роботу
Опишіть свою пропозицію
Реєстрація та подання заявок у проекти є безкоштовними
5 фрілансерів(-и) готові виконати цю роботу у середньому за $138 USD
Аватарка користувача
Hello Sir, I am a computer science tutor, I teach (among others) Haskell, LISP, Prolog, and Advanced Algorithms. I have done many projects like this, and I'm one of the top Haskell developers, and you can check by clicking on my profile picture. Please contact me for more details when possible. I look forward to work for you, Sir. Best Regards.
$150 USD за 2 дні(-в)
4,9 (75 відгуки(-ів))
6,3
6,3
Аватарка користувача
I have been using Haskell for over ten years now, and I'm starting to get the hang of it. I was a math and English major and graduated from Caltech in 1975. I've been programming since then in Fortran, Forth, Perl, and most recently, Haskell. I went ahead and started your project, just to see how complicated it was. Here is the code so far: module Board where data Board = B { nCols :: Int , nRows :: Int , b :: [[Int]] } deriving Show mkBoard :: Int -> Int -> Board mkBoard m n = B m n (replicate m (replicate n 0)) type Player = Int mkPlayer, mkOpponennt :: Player mkPlayer = 1 mkOpponennt = 2 col :: Int -> Board -> [Int] col i bd = (b bd) !! (i-1) replaceAt :: Int -> a -> [a] -> [a] replaceAt i new lofl = let (before,(_:after)) = splitAt (i-1) lofl in before ++ (new:after) dropInSlot :: Board -> Int -> Player -> Board dropInSlot bd i p = let c = col i bd (before,after) = span (== 0) c newCol = init before ++ (p:after) newB = replaceAt i newCol (b bd) in bd {b = newB} playerToChar :: Player -> Char playerToChar 0 = '.' playerToChar 1 = 'X' playerToChar 2 = 'O' transpose :: [[a]] -> [[a]] transpose [] = [] transpose ([] : xss) = transpose xss transpose ((x:xs) : xss) = (x : [h | (h:_) <- xss]) : transpose (xs : [ t | (_:t) <- xss]) boardToStr playerToChar bd = let t = transpose (b bd) withSpaces p = [' ', playerToChar p] in unlines . map (concatMap withSpaces) $ t play with it if you like
$100 USD за 3 дні(-в)
5,0 (8 відгуки(-ів))
3,2
3,2
Аватарка користувача
Write me, what kind of help do you need. Are you asking for writing the entire project or explaining some aspects? :)
$222 USD за 4 дні(-в)
0,0 (0 відгуки(-ів))
0,0
0,0

Про клієнта

Прапор UNITED STATES
El Paso, United States
0,0
0
На сайті з лист. 29, 2018

Верифікація клієнта

Дякуємо! Ми надіслали на вашу електронну пошту посилання для отримання безкоштовного кредиту.
Під час надсилання електронного листа сталася помилка. Будь ласка, спробуйте ще раз.
Зареєстрованих користувачів Загальна кількість опублікованих робіт
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Завантажуємо для перегляду
Дозвіл на визначення геолокації надано.
Ваш сеанс входу закінчився, і сеанс було закрито. Будь ласка, увійдіть знову.